Author: fireball
Date: Sat Jan 3 03:18:55 2009
New Revision: 38521
URL:
http://svn.reactos.org/svn/reactos?rev=38521&view=rev
Log:
- Add a missing EA buffer validation.
- Free an EA buffer if it was allocated and error/exception happened.
Modified:
trunk/reactos/ntoskrnl/io/iomgr/file.c
Modified: trunk/reactos/ntoskrnl/io/iomgr/file.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/file.c?r…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/file.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/file.c [iso-8859-1] Sat Jan 3 03:18:55 2009
@@ -1700,6 +1700,16 @@
}
RtlCopyMemory(SystemEaBuffer, EaBuffer, EaLength);
+
+ /* Validate the buffer */
+ Status = IoCheckEaBufferValidity(SystemEaBuffer,
+ EaLength,
+ &EaErrorOffset);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("FIXME: IoCheckEaBufferValidity() failed with "
+ "Status: %lx\n",Status);
+ }
}
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
@@ -1708,7 +1718,14 @@
}
_SEH2_END;
- if(!NT_SUCCESS(Status)) return Status;
+ if(!NT_SUCCESS(Status))
+ {
+ /* Free SystemEaBuffer if needed */
+ if (SystemEaBuffer) ExFreePoolWithTag(SystemEaBuffer, TAG_EA);
+
+ /* Return failure status */
+ return Status;
+ }
}
else
{