https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b030836b408700f45555e…
commit b030836b408700f45555ee252e6a5fcaeb386e46
Author: Thomas Faber <thomas.faber(a)reactos.org>
AuthorDate: Thu Feb 1 11:08:14 2018 +0100
Commit: Thomas Faber <thomas.faber(a)reactos.org>
CommitDate: Sun Feb 18 11:27:35 2018 +0100
[WIN32K:NTUSER] Safely handle allocation failure in IntCloneMenu. CORE-14222
---
win32ss/user/ntuser/menu.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/win32ss/user/ntuser/menu.c b/win32ss/user/ntuser/menu.c
index 46382e4815..888b4ea696 100644
--- a/win32ss/user/ntuser/menu.c
+++ b/win32ss/user/ntuser/menu.c
@@ -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;