Author: jimtabor
Date: Wed Aug 26 03:07:32 2009
New Revision: 42934
URL:
http://svn.reactos.org/svn/reactos?rev=42934&view=rev
Log:
- Fix a crash in SetMenuInfo.
Modified:
trunk/reactos/dll/win32/user32/windows/menu.c
Modified: trunk/reactos/dll/win32/user32/windows/menu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/m…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/menu.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/menu.c [iso-8859-1] Wed Aug 26 03:07:32 2009
@@ -4993,8 +4993,12 @@
{
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);