diff --git a/channels/drive/client/drive_file.c b/channels/drive/client/drive_file.c index 8f03fd858..cefa340a6 100644 --- a/channels/drive/client/drive_file.c +++ b/channels/drive/client/drive_file.c @@ -94,7 +94,7 @@ static WCHAR* drive_file_combine_fullpath(const WCHAR* base_path, const WCHAR* p WCHAR* fullpath; size_t base_path_length; - if (!base_path || !path) + if (!base_path || (!path && (PathLength > 0))) return NULL; base_path_length = _wcslen(base_path) * 2; @@ -338,7 +338,7 @@ DRIVE_FILE* drive_file_new(const WCHAR* base_path, const WCHAR* path, UINT32 Pat { DRIVE_FILE* file; - if (!base_path || !path) + if (!base_path || (!path && (PathLength > 0))) return NULL; file = (DRIVE_FILE*)calloc(1, sizeof(DRIVE_FILE)); diff --git a/channels/drive/client/drive_main.c b/channels/drive/client/drive_main.c index 65e1317f8..494764a8d 100644 --- a/channels/drive/client/drive_main.c +++ b/channels/drive/client/drive_main.c @@ -163,7 +163,7 @@ static UINT drive_process_irp_create(DRIVE_DEVICE* drive, IRP* irp) UINT32 CreateOptions; UINT32 PathLength; UINT64 allocationSize; - const WCHAR* path = NULL; + const WCHAR* path; if (!drive || !irp || !irp->devman || !irp->Complete) return ERROR_INVALID_PARAMETER; @@ -182,8 +182,7 @@ static UINT drive_process_irp_create(DRIVE_DEVICE* drive, IRP* irp) if (Stream_GetRemainingLength(irp->input) < PathLength) return ERROR_INVALID_DATA; - if (PathLength > 0) - path = (const WCHAR*)Stream_Pointer(irp->input); + 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);