[NTOS:IO]
authorThomas Faber <thomas.faber@reactos.org>
Wed, 6 Apr 2016 20:00:34 +0000 (20:00 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Wed, 6 Apr 2016 20:00:34 +0000 (20:00 +0000)
- Handle RtlCreateUnicodeString failure in IopInitializeBuiltinDriver. Patch by Víctor Martínez Calvo. CID 1341416
CORE-11029 #resolve

svn path=/trunk/; revision=71109

reactos/ntoskrnl/io/iomgr/driver.c

index eff280e..499e42f 100644 (file)
@@ -874,6 +874,7 @@ IopInitializeBuiltinDriver(IN PLDR_DATA_TABLE_ENTRY BootLdrEntry)
     PLDR_DATA_TABLE_ENTRY LdrEntry;
     PLIST_ENTRY NextEntry;
     UNICODE_STRING ServiceName;
+    BOOLEAN Success;
 
     /*
      * Display 'Loading XXX...' message
@@ -897,7 +898,12 @@ IopInitializeBuiltinDriver(IN PLDR_DATA_TABLE_ENTRY BootLdrEntry)
     /*
      * Strip the file extension from ServiceName
      */
-    RtlCreateUnicodeString(&ServiceName, FileNameWithoutPath);
+    Success = RtlCreateUnicodeString(&ServiceName, FileNameWithoutPath);
+    if (!Success)
+    {
+        return STATUS_INSUFFICIENT_RESOURCES;
+    }
+
     FileExtension = wcsrchr(ServiceName.Buffer, '.');
     if (FileExtension != NULL)
     {