- fixed uninitialized variable warning
- ProbeAndCaptureUnicodeString should check if allocating memory succeeded
Modified: trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h
Modified: trunk/reactos/ntoskrnl/io/driver.c

Modified: trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h
--- trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h	2005-09-25 17:25:55 UTC (rev 18060)
+++ trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h	2005-09-25 17:49:14 UTC (rev 18061)
@@ -130,11 +130,16 @@
     /* Allocate space for the buffer */
     Buffer = ExAllocatePool(PagedPool, Dest->MaximumLength);
 
-    /* Copy it */
-    RtlCopyMemory(Buffer, Dest->Buffer, Dest->MaximumLength);
+    if (Buffer != NULL)
+    {
+        /* Copy it */
+        RtlCopyMemory(Buffer, Dest->Buffer, Dest->MaximumLength);
 
-    /* Set it as the buffer */
-    Dest->Buffer = Buffer;
+        /* Set it as the buffer */
+        Dest->Buffer = Buffer;
+    }
+    else
+        Status = STATUS_INSUFFICIENT_RESOURCES;
 
     /* Return */
     return Status;

Modified: trunk/reactos/ntoskrnl/io/driver.c
--- trunk/reactos/ntoskrnl/io/driver.c	2005-09-25 17:25:55 UTC (rev 18060)
+++ trunk/reactos/ntoskrnl/io/driver.c	2005-09-25 17:49:14 UTC (rev 18061)
@@ -1852,7 +1852,7 @@
    RTL_QUERY_REGISTRY_TABLE QueryTable[3];
    UNICODE_STRING ImagePath;
    UNICODE_STRING ServiceName;
-   UNICODE_STRING CapturedDriverServiceName;
+   UNICODE_STRING CapturedDriverServiceName = {0};
    KPROCESSOR_MODE PreviousMode;
    NTSTATUS Status;
    ULONG Type;