mirror of
https://github.com/reactos/reactos.git
synced 2026-06-02 17:31:23 +08:00
[NTUSER] IntTrackPopupMenuEx: Check TPMPARAMS.cbSize (#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.
This commit is contained in:
committed by
GitHub
parent
6dd04063ba
commit
5b4d1dbd4b
@@ -4580,6 +4580,13 @@ BOOL WINAPI IntTrackPopupMenuEx( PMENU menu, UINT wFlags, int x, int y,
|
||||
BOOL ret = FALSE;
|
||||
PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
|
||||
|
||||
if (lpTpm && lpTpm->cbSize != sizeof(*lpTpm))
|
||||
{
|
||||
ERR("Invalid TPMPARAMS size: got %u, expected %zu\n", lpTpm->cbSize, sizeof(*lpTpm));
|
||||
EngSetLastError(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (pti != pWnd->head.pti)
|
||||
{
|
||||
ERR("Must be the same pti!\n");
|
||||
|
||||
Reference in New Issue
Block a user