https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c464f4f2e3c150593d428…
commit c464f4f2e3c150593d4282062fc8e193683a871f
Author: Thomas Faber <thomas.faber(a)reactos.org>
AuthorDate: Thu Feb 1 11:06:03 2018 +0100
Commit: Thomas Faber <thomas.faber(a)reactos.org>
CommitDate: Sun Feb 18 11:27:27 2018 +0100
[WIN32K:NTUSER] Handle allocation failure in PopupMenuWndProc. CORE-14222
---
win32ss/user/ntuser/menu.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/win32ss/user/ntuser/menu.c b/win32ss/user/ntuser/menu.c
index 4de96e892a..8432f3a83f 100644
--- a/win32ss/user/ntuser/menu.c
+++ b/win32ss/user/ntuser/menu.c
@@ -4436,6 +4436,10 @@ PopupMenuWndProc(
}
Wnd->fnid = FNID_MENU;
pPopupMenu = DesktopHeapAlloc( Wnd->head.rpdesk, sizeof(POPUPMENU) );
+ if (pPopupMenu == NULL)
+ {
+ return TRUE;
+ }
pPopupMenu->posSelectedItem = NO_SELECTED_ITEM;
pPopupMenu->spwndPopupMenu = Wnd;
((PMENUWND)Wnd)->ppopupmenu = pPopupMenu;