https://git.reactos.org/?p=reactos.git;a=commitdiff;h=89217e3df563a4e843b18…
commit 89217e3df563a4e843b18a4c6deca83994834e8e
Author: Thomas Faber <thomas.faber(a)reactos.org>
AuthorDate: Sat Mar 3 08:19:13 2018 +0100
Commit: Thomas Faber <thomas.faber(a)reactos.org>
CommitDate: Sat Mar 3 17:18:55 2018 +0100
[WIN32K:NTUSER] Handle IntCloneMenu failure in MENU_GetSystemMenu. CORE-12180
---
win32ss/user/ntuser/menu.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/win32ss/user/ntuser/menu.c b/win32ss/user/ntuser/menu.c
index 888b4ea696..dc6656ffb3 100644
--- a/win32ss/user/ntuser/menu.c
+++ b/win32ss/user/ntuser/menu.c
@@ -5120,6 +5120,12 @@ PMENU FASTCALL MENU_GetSystemMenu(PWND Window, PMENU Popup)
IntMenuItemInfo(Menu, SC_MINIMIZE, FALSE, &ItemInfoSet, TRUE, NULL);
NewMenu = IntCloneMenu(Menu);
+ if (NewMenu == NULL)
+ {
+ IntDestroyMenuObject(Menu, FALSE);
+ IntDestroyMenuObject(SysMenu, FALSE);
+ return NULL;
+ }
IntReleaseMenuObject(NewMenu);
UserSetMenuDefaultItem(NewMenu, SC_CLOSE, FALSE);