mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
[NTOS:IO] Properly zero-initialize a file object created by IopParseDevice (#4931)
Fix uninitialized kernel memory leakage for a case when a file object extension is appended. CORE-18711
This commit is contained in:
parent
1341c384f2
commit
82cf6c2b06
1 changed files with 2 additions and 1 deletions
|
@ -857,7 +857,7 @@ IopParseDevice(IN PVOID ParseObject,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Clear the file object */
|
/* Clear the file object */
|
||||||
RtlZeroMemory(FileObject, sizeof(FILE_OBJECT));
|
RtlZeroMemory(FileObject, ObjectSize);
|
||||||
|
|
||||||
/* Check if this is Synch I/O */
|
/* Check if this is Synch I/O */
|
||||||
if (OpenPacket->CreateOptions &
|
if (OpenPacket->CreateOptions &
|
||||||
|
@ -917,6 +917,7 @@ IopParseDevice(IN PVOID ParseObject,
|
||||||
/* Make sure the file object knows it has an extension */
|
/* Make sure the file object knows it has an extension */
|
||||||
FileObject->Flags |= FO_FILE_OBJECT_HAS_EXTENSION;
|
FileObject->Flags |= FO_FILE_OBJECT_HAS_EXTENSION;
|
||||||
|
|
||||||
|
/* Initialize file object extension */
|
||||||
FileObjectExtension = (PFILE_OBJECT_EXTENSION)(FileObject + 1);
|
FileObjectExtension = (PFILE_OBJECT_EXTENSION)(FileObject + 1);
|
||||||
FileObject->FileObjectExtension = FileObjectExtension;
|
FileObject->FileObjectExtension = FileObjectExtension;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue