[ros-diffs] [cgutman] 41249: - Fix a potential crash in IoGetLowerDeviceObject if nothing is attached to us

cgutman at svn.reactos.org cgutman at svn.reactos.org
Tue Jun 2 03:34:13 CEST 2009


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?rev=41249&r1=41248&r2=41249&view=diff
==============================================================================
--- 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 */



More information about the Ros-diffs mailing list