[WIN32K:NTUSER]

- Don't leak the captured string in NtUserThunkedMenuItemInfo
CORE-10493

svn path=/trunk/; revision=69846
This commit is contained in:
Thomas Faber 2015-11-08 07:57:14 +00:00
parent 6d16a3e430
commit b90b19966b

View file

@ -6216,13 +6216,13 @@ NtUserThunkedMenuItemInfo(
/* lpszCaption may be NULL, check for it and call RtlInitUnicodeString() /* lpszCaption may be NULL, check for it and call RtlInitUnicodeString()
if bInsert == TRUE call UserInsertMenuItem() else UserSetMenuItemInfo() */ if bInsert == TRUE call UserInsertMenuItem() else UserSetMenuItemInfo() */
RtlInitEmptyUnicodeString(&lstrCaption, NULL, 0);
if (!(Menu = UserGetMenuObject(hMenu))) if (!(Menu = UserGetMenuObject(hMenu)))
{ {
RETURN(FALSE); RETURN(FALSE);
} }
RtlInitUnicodeString(&lstrCaption, 0);
/* Check if we got a Caption */ /* Check if we got a Caption */
if (lpszCaption && lpszCaption->Buffer) if (lpszCaption && lpszCaption->Buffer)
{ {
@ -6243,6 +6243,11 @@ NtUserThunkedMenuItemInfo(
RETURN( UserMenuItemInfo(Menu, uItem, fByPosition, (PROSMENUITEMINFO)lpmii, TRUE, &lstrCaption)); RETURN( UserMenuItemInfo(Menu, uItem, fByPosition, (PROSMENUITEMINFO)lpmii, TRUE, &lstrCaption));
CLEANUP: CLEANUP:
if (lstrCaption.Buffer)
{
ReleaseCapturedUnicodeString(&lstrCaption, UserMode);
}
TRACE("Leave NtUserThunkedMenuItemInfo, ret=%i\n",_ret_); TRACE("Leave NtUserThunkedMenuItemInfo, ret=%i\n",_ret_);
UserLeave(); UserLeave();
END_CLEANUP; END_CLEANUP;