From: Thomas Faber Date: Thu, 1 Feb 2018 10:08:14 +0000 (+0100) Subject: [WIN32K:NTUSER] Safely handle allocation failure in IntCloneMenu. CORE-14222 X-Git-Tag: 0.4.9-RC~792 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=b030836b408700f45555ee252e6a5fcaeb386e46 [WIN32K:NTUSER] Safely handle allocation failure in IntCloneMenu. CORE-14222 --- diff --git a/win32ss/user/ntuser/menu.c b/win32ss/user/ntuser/menu.c index 46382e48159..888b4ea696e 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;