Author: greatlrd
Date: Mon Jul 10 23:32:24 2006
New Revision: 23003
URL:
http://svn.reactos.org/svn/reactos?rev=23003&view=rev
Log:
Fixing two user mode crash for menu.
Do not try reading from NULL pointer and compare the value.
This let me come bit futer with user32_winetest.exe, but we still have some user mode
crash with menu.
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 (original)
+++ trunk/reactos/dll/win32/user32/windows/menu.c Mon Jul 10 23:32:24 2006
@@ -4488,10 +4488,13 @@
HeapFree(GetProcessHeap(),0, mii.dwTypeData);
}
/* Item beginning with a backspace is a help item */
- if (*lpNewItem == '\b')
- {
- mii.fType |= MF_HELP;
- lpNewItem++;
+ if (lpNewItem != NULL)
+ {
+ if (*lpNewItem == '\b')
+ {
+ mii.fType |= MF_HELP;
+ lpNewItem++;
+ }
}
mii.fMask |= MIIM_TYPE;
mii.dwTypeData = (LPSTR)lpNewItem;
@@ -4579,14 +4582,18 @@
}
else
{
- /*if(mii.dwTypeData != NULL)
+ /*
+ if(mii.dwTypeData != NULL)
{
HeapFree(GetProcessHeap(),0, mii.dwTypeData);
- }*/
- if (*lpNewItem == '\b')
- {
- mii.fType |= MF_HELP;
- lpNewItem++;
+ } */
+ if (lpNewItem != NULL)
+ {
+ if (*lpNewItem == '\b')
+ {
+ mii.fType |= MF_HELP;
+ lpNewItem++;
+ }
}
mii.fMask |= MIIM_TYPE;
mii.dwTypeData = (LPWSTR)lpNewItem;