IntRegisterClass did not check for NULL pointer when it alloc memory.
Modified: trunk/reactos/subsys/win32k/ntuser/class.c
_____
Modified: trunk/reactos/subsys/win32k/ntuser/class.c
--- trunk/reactos/subsys/win32k/ntuser/class.c 2005-12-29 12:13:02 UTC
(rev 20418)
+++ trunk/reactos/subsys/win32k/ntuser/class.c 2005-12-29 12:40:31 UTC
(rev 20419)
@@ -208,6 +208,27 @@
Class->hIconSm = lpwcx->hIconSm;
Class->Atom = Atom;
+ if (MenuName->Length == 0)
+ {
+ Class->lpszMenuName.Length =
+ Class->lpszMenuName.MaximumLength = 0;
+ Class->lpszMenuName.Buffer = MenuName->Buffer;
+ }
+ else
+ {
+ Class->lpszMenuName.Length =
+ Class->lpszMenuName.MaximumLength = MenuName->MaximumLength;
+ Class->lpszMenuName.Buffer = ExAllocatePoolWithTag(PagedPool,
Class->lpszMenuName.MaximumLength, TAG_STRING);
+
+ if (Class->lpszMenuName.Buffer == NULL)
+ {
+ SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
+ return(FALSE);
+ }
+
+ RtlCopyUnicodeString(&Class->lpszMenuName, MenuName);
+ }
+
if (wpExtra == NULL)
{
if (Flags & REGISTERCLASS_ANSI)
@@ -235,19 +256,7 @@
}
}
- if (MenuName->Length == 0)
- {
- Class->lpszMenuName.Length =
- Class->lpszMenuName.MaximumLength = 0;
- Class->lpszMenuName.Buffer = MenuName->Buffer;
- }
- else
- {
- Class->lpszMenuName.Length =
- Class->lpszMenuName.MaximumLength = MenuName->MaximumLength;
- Class->lpszMenuName.Buffer = ExAllocatePoolWithTag(PagedPool,
Class->lpszMenuName.MaximumLength, TAG_STRING);
- RtlCopyUnicodeString(&Class->lpszMenuName, MenuName);
- }
+
/* Extra class data */
if (Class->cbClsExtra)
Show replies by date