- Fix a crash in SetMenuInfo.
authorJames Tabor <james.tabor@reactos.org>
Wed, 26 Aug 2009 01:07:32 +0000 (01:07 +0000)
committerJames Tabor <james.tabor@reactos.org>
Wed, 26 Aug 2009 01:07:32 +0000 (01:07 +0000)
svn path=/trunk/; revision=42934

reactos/dll/win32/user32/windows/menu.c

index 0163ef4..98e6fa6 100644 (file)
@@ -4993,8 +4993,12 @@ SetMenuInfo(
 {
   ROSMENUINFO mi;
   BOOL res = FALSE;
-  if(lpcmi->cbSize != sizeof(MENUINFO))
+
+  if (!lpcmi || (lpcmi->cbSize != sizeof(MENUINFO)))
+  {
+    SetLastError(ERROR_INVALID_PARAMETER);
     return res;
+  }
 
   memcpy(&mi, lpcmi, sizeof(MENUINFO));
   return NtUserMenuInfo(hmenu, &mi, TRUE);