mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 14:53:40 +00:00
[WIN32K:NTUSER]
- Don't leak the captured string in NtUserThunkedMenuItemInfo CORE-10493 svn path=/trunk/; revision=69846
This commit is contained in:
parent
6d16a3e430
commit
b90b19966b
1 changed files with 7 additions and 2 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue