[WIN32K:NTUSER] Safely handle allocation failure in IntCloneMenu. CORE-14222

This commit is contained in:
Thomas Faber 2018-02-01 11:08:14 +01:00
parent 1969094028
commit b030836b40
No known key found for this signature in database
GPG key ID: 076E7C3D44720826

View file

@ -815,6 +815,7 @@ IntCloneMenuItems(PMENU Destination, PMENU Source)
NewMenuItem->Xlpstr = NewMenuItem->lpstr.Buffer;
}
NewMenuItem->hbmp = MenuItem->hbmp;
Destination->cItems = i + 1;
}
return TRUE;
}
@ -847,7 +848,7 @@ IntCloneMenu(PMENU Source)
Menu->spwndNotify = NULL;
Menu->cyMenu = 0;
Menu->cxMenu = 0;
Menu->cItems = Source->cItems;
Menu->cItems = 0;
Menu->iTop = 0;
Menu->iMaxTop = 0;
Menu->cxTextAlign = 0;