Skip to content

Commit 5b4d1db

Browse files
authored
[NTUSER] IntTrackPopupMenuEx: Check TPMPARAMS.cbSize (reactos#8092)
Validate structure size. JIRA issue: CORE-3247 - In IntTrackPopupMenuEx function, if lpTpm was non-NULL, then validate lpTpm->cbSize. - If validation failed, then set last error and return FALSE.
1 parent 6dd0406 commit 5b4d1db

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

win32ss/user/ntuser/menu.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4580,6 +4580,13 @@ BOOL WINAPI IntTrackPopupMenuEx( PMENU menu, UINT wFlags, int x, int y,
45804580
BOOL ret = FALSE;
45814581
PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
45824582

4583+
if (lpTpm && lpTpm->cbSize != sizeof(*lpTpm))
4584+
{
4585+
ERR("Invalid TPMPARAMS size: got %u, expected %zu\n", lpTpm->cbSize, sizeof(*lpTpm));
4586+
EngSetLastError(ERROR_INVALID_PARAMETER);
4587+
return FALSE;
4588+
}
4589+
45834590
if (pti != pWnd->head.pti)
45844591
{
45854592
ERR("Must be the same pti!\n");

0 commit comments

Comments
 (0)