Fixed #5727: drive_process_irp_create set path to NULL if not provided.

This commit is contained in:
Armin Novak 2019-11-18 14:30:15 +01:00
parent 9f3adf10f8
commit 4c5bfcc235

View File

@ -163,7 +163,7 @@ static UINT drive_process_irp_create(DRIVE_DEVICE* drive, IRP* irp)
UINT32 CreateOptions;
UINT32 PathLength;
UINT64 allocationSize;
const WCHAR* path;
const WCHAR* path = NULL;
if (!drive || !irp || !irp->devman || !irp->Complete)
return ERROR_INVALID_PARAMETER;
@ -182,7 +182,8 @@ static UINT drive_process_irp_create(DRIVE_DEVICE* drive, IRP* irp)
if (Stream_GetRemainingLength(irp->input) < PathLength)
return ERROR_INVALID_DATA;
path = (WCHAR*)Stream_Pointer(irp->input);
if (PathLength > 0)
path = (const WCHAR*)Stream_Pointer(irp->input);
FileId = irp->devman->id_sequence++;
file = drive_file_new(drive->path, path, PathLength, FileId, DesiredAccess, CreateDisposition,
CreateOptions, FileAttributes, SharedAccess);