[WIN32K:NTUSER] Avoid allocating an extra item in IntCloneMenuItems. CORE-14222

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

View file

@ -778,10 +778,10 @@ IntCloneMenuItems(PMENU Destination, PMENU Source)
if(!Source->cItems)
return FALSE;
NewMenuItem = DesktopHeapAlloc(Destination->head.rpdesk, (Source->cItems+1) * sizeof(ITEM));
NewMenuItem = DesktopHeapAlloc(Destination->head.rpdesk, Source->cItems * sizeof(ITEM));
if(!NewMenuItem) return FALSE;
RtlZeroMemory(NewMenuItem, (Source->cItems+1) * sizeof(ITEM));
RtlZeroMemory(NewMenuItem, Source->cItems * sizeof(ITEM));
Destination->rgItems = NewMenuItem;