Author: pschweitzer
Date: Tue May 2 21:32:20 2017
New Revision: 74451
URL:
http://svn.reactos.org/svn/reactos?rev=74451&view=rev
Log:
[NTOSKNRL]
Misc fixes in NtQueryDirectoryFile():
- Don't leak auxbuffer
- Don't allow two completion routines
Modified:
trunk/reactos/ntoskrnl/io/iomgr/iofunc.c
Modified: trunk/reactos/ntoskrnl/io/iomgr/iofunc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/iofunc.c…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/iofunc.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/iofunc.c [iso-8859-1] Tue May 2 21:32:20 2017
@@ -1901,6 +1901,14 @@
return Status;
}
+ /* Are there two associated completion routines? */
+ if (FileObject->CompletionContext != NULL && ApcRoutine != NULL)
+ {
+ ObDereferenceObject(FileObject);
+ if (AuxBuffer) ExFreePoolWithTag(AuxBuffer, TAG_SYSB);
+ return STATUS_INVALID_PARAMETER;
+ }
+
/* Check if we have an even handle */
if (EventHandle)
{
@@ -1914,6 +1922,7 @@
if (!NT_SUCCESS(Status))
{
/* Fail */
+ if (AuxBuffer) ExFreePoolWithTag(AuxBuffer, TAG_SYSB);
ObDereferenceObject(FileObject);
return Status;
}