[ros-diffs] [greatlrd] 20418: DRIVER_RegisterDriver did not check
for NULL pointer when it alloc memory.
greatlrd at svn.reactos.org
greatlrd at svn.reactos.org
Thu Dec 29 15:49:15 CET 2005
DRIVER_RegisterDriver did not check for NULL pointer when it alloc
memory.
Modified: trunk/reactos/subsys/win32k/misc/driver.c
_____
Modified: trunk/reactos/subsys/win32k/misc/driver.c
--- trunk/reactos/subsys/win32k/misc/driver.c 2005-12-29 11:20:30 UTC
(rev 20417)
+++ trunk/reactos/subsys/win32k/misc/driver.c 2005-12-29 12:13:02 UTC
(rev 20418)
@@ -54,6 +54,13 @@
Driver->Name = ExAllocatePoolWithTag(PagedPool,
(wcslen(Name) + 1) *
sizeof(WCHAR),
TAG_DRIVER);
+ if (Driver->Name == NULL)
+ {
+ DPRINT1("Out of memory\n");
+ ExFreePool(Driver);
+ return FALSE;
+ }
+
wcscpy(Driver->Name, Name);
Driver->Next = DriverList;
DriverList = Driver;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20051229/bd4b8ee0/attachment.html
More information about the Ros-diffs
mailing list