mirror of
https://github.com/reactos/reactos.git
synced 2024-12-05 09:23:32 +08:00
[NTOSKRNL] In IopQueryNameInternal() don't copy name if it's not valid
This commit is contained in:
parent
4a7e89770e
commit
46bda8a4c6
@ -2004,6 +2004,14 @@ IopQueryNameInternal(IN PVOID ObjectBody,
|
||||
(ULONG_PTR)ObjectNameInfo +
|
||||
LocalFileInfo->FileNameLength);
|
||||
|
||||
/* Don't copy the name if it's not valid */
|
||||
if (LocalFileInfo->FileName[0] != OBJ_NAME_PATH_SEPARATOR)
|
||||
{
|
||||
/* Free the allocated buffer and return failure */
|
||||
ExFreePoolWithTag(LocalInfo, TAG_IO);
|
||||
return STATUS_OBJECT_PATH_INVALID;
|
||||
}
|
||||
|
||||
/* Write the Name and null-terminate it */
|
||||
RtlCopyMemory(p, LocalFileInfo->FileName, FileLength);
|
||||
p += (FileLength / sizeof(WCHAR));
|
||||
|
Loading…
Reference in New Issue
Block a user