From 4c5bfcc235cf5cd8410b4b490b3db3589f0b895f Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Mon, 18 Nov 2019 14:30:15 +0100 Subject: [PATCH] Fixed #5727: drive_process_irp_create set path to NULL if not provided. --- channels/drive/client/drive_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/channels/drive/client/drive_main.c b/channels/drive/client/drive_main.c index 0ac854c..65e1317 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; + 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); -- 2.7.4