Fixed path NULL checks.
This commit is contained in:
parent
4c5bfcc235
commit
f9b3f270fe
@ -94,7 +94,7 @@ static WCHAR* drive_file_combine_fullpath(const WCHAR* base_path, const WCHAR* p
|
|||||||
WCHAR* fullpath;
|
WCHAR* fullpath;
|
||||||
size_t base_path_length;
|
size_t base_path_length;
|
||||||
|
|
||||||
if (!base_path || !path)
|
if (!base_path || (!path && (PathLength > 0)))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
base_path_length = _wcslen(base_path) * 2;
|
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;
|
DRIVE_FILE* file;
|
||||||
|
|
||||||
if (!base_path || !path)
|
if (!base_path || (!path && (PathLength > 0)))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
file = (DRIVE_FILE*)calloc(1, sizeof(DRIVE_FILE));
|
file = (DRIVE_FILE*)calloc(1, sizeof(DRIVE_FILE));
|
||||||
|
@ -163,7 +163,7 @@ static UINT drive_process_irp_create(DRIVE_DEVICE* drive, IRP* irp)
|
|||||||
UINT32 CreateOptions;
|
UINT32 CreateOptions;
|
||||||
UINT32 PathLength;
|
UINT32 PathLength;
|
||||||
UINT64 allocationSize;
|
UINT64 allocationSize;
|
||||||
const WCHAR* path = NULL;
|
const WCHAR* path;
|
||||||
|
|
||||||
if (!drive || !irp || !irp->devman || !irp->Complete)
|
if (!drive || !irp || !irp->devman || !irp->Complete)
|
||||||
return ERROR_INVALID_PARAMETER;
|
return ERROR_INVALID_PARAMETER;
|
||||||
@ -182,7 +182,6 @@ static UINT drive_process_irp_create(DRIVE_DEVICE* drive, IRP* irp)
|
|||||||
if (Stream_GetRemainingLength(irp->input) < PathLength)
|
if (Stream_GetRemainingLength(irp->input) < PathLength)
|
||||||
return ERROR_INVALID_DATA;
|
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++;
|
FileId = irp->devman->id_sequence++;
|
||||||
file = drive_file_new(drive->path, path, PathLength, FileId, DesiredAccess, CreateDisposition,
|
file = drive_file_new(drive->path, path, PathLength, FileId, DesiredAccess, CreateDisposition,
|
||||||
|
Loading…
Reference in New Issue
Block a user