Author: cgutman
Date: Tue Jun 2 05:34:12 2009
New Revision: 41249
URL:
http://svn.reactos.org/svn/reactos?rev=41249&view=rev
Log:
- Fix a potential crash in IoGetLowerDeviceObject if nothing is attached to us
Modified:
trunk/reactos/ntoskrnl/io/iomgr/device.c
Modified: trunk/reactos/ntoskrnl/io/iomgr/device.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/device.c…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/device.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/device.c [iso-8859-1] Tue Jun 2 05:34:12 2009
@@ -1186,8 +1186,12 @@
/* Get the Lower Device Object */
LowerDeviceObject = DeviceExtension->AttachedTo;
- /* Reference it */
- ObReferenceObject(LowerDeviceObject);
+ /* Check that we got a valid device object */
+ if (LowerDeviceObject)
+ {
+ /* We did so let's reference it */
+ ObReferenceObject(LowerDeviceObject);
+ }
}
/* Return it */