mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:03:00 +00:00
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. svn path=/trunk/; revision=23003
This commit is contained in:
parent
fa1e866a00
commit
06f4494f85
1 changed files with 17 additions and 10 deletions
|
@ -4488,10 +4488,13 @@ ModifyMenuA(
|
||||||
HeapFree(GetProcessHeap(),0, mii.dwTypeData);
|
HeapFree(GetProcessHeap(),0, mii.dwTypeData);
|
||||||
}
|
}
|
||||||
/* Item beginning with a backspace is a help item */
|
/* Item beginning with a backspace is a help item */
|
||||||
if (*lpNewItem == '\b')
|
if (lpNewItem != NULL)
|
||||||
{
|
{
|
||||||
mii.fType |= MF_HELP;
|
if (*lpNewItem == '\b')
|
||||||
lpNewItem++;
|
{
|
||||||
|
mii.fType |= MF_HELP;
|
||||||
|
lpNewItem++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
mii.fMask |= MIIM_TYPE;
|
mii.fMask |= MIIM_TYPE;
|
||||||
mii.dwTypeData = (LPSTR)lpNewItem;
|
mii.dwTypeData = (LPSTR)lpNewItem;
|
||||||
|
@ -4579,14 +4582,18 @@ ModifyMenuW(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/*if(mii.dwTypeData != NULL)
|
/*
|
||||||
|
if(mii.dwTypeData != NULL)
|
||||||
{
|
{
|
||||||
HeapFree(GetProcessHeap(),0, mii.dwTypeData);
|
HeapFree(GetProcessHeap(),0, mii.dwTypeData);
|
||||||
}*/
|
} */
|
||||||
if (*lpNewItem == '\b')
|
if (lpNewItem != NULL)
|
||||||
{
|
{
|
||||||
mii.fType |= MF_HELP;
|
if (*lpNewItem == '\b')
|
||||||
lpNewItem++;
|
{
|
||||||
|
mii.fType |= MF_HELP;
|
||||||
|
lpNewItem++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
mii.fMask |= MIIM_TYPE;
|
mii.fMask |= MIIM_TYPE;
|
||||||
mii.dwTypeData = (LPWSTR)lpNewItem;
|
mii.dwTypeData = (LPWSTR)lpNewItem;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue