https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1969094028f166e7354ec…
commit 1969094028f166e7354ec639a5d38e4ef02716e5
Author: Thomas Faber <thomas.faber(a)reactos.org>
AuthorDate: Thu Feb 1 11:07:39 2018 +0100
Commit: Thomas Faber <thomas.faber(a)reactos.org>
CommitDate: Sun Feb 18 11:27:32 2018 +0100
[WIN32K:NTUSER] Avoid allocating an extra item in IntCloneMenuItems. CORE-14222
---
win32ss/user/ntuser/menu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/win32ss/user/ntuser/menu.c b/win32ss/user/ntuser/menu.c
index 5ecffbb8e3..46382e4815 100644
--- a/win32ss/user/ntuser/menu.c
+++ b/win32ss/user/ntuser/menu.c
@@ -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;