[USER32_APITEST] Follow-up of c39bf0d

Avoid buffer overflow. CORE-15289, CORE-11700
This commit is contained in:
Katayama Hirofumi MZ 2023-03-20 16:33:11 +09:00
parent c39bf0d54b
commit 7c14c0ed73

View file

@ -182,7 +182,8 @@ EditWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
MD_msgdump(hwnd, uMsg, wParam, lParam);
/* Add message */
s_Msgs[s_cMsgs++] = msg;
if (s_cMsgs < MAX_MSGS)
s_Msgs[s_cMsgs++] = msg;
/* Do inner task */
ret = CallWindowProc(s_fnOldEditWndProc, hwnd, uMsg, wParam, lParam);
@ -207,7 +208,8 @@ ImeWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
MD_msgdump(hwnd, uMsg, wParam, lParam);
/* Add message */
s_Msgs[s_cMsgs++] = msg;
if (s_cMsgs < MAX_MSGS)
s_Msgs[s_cMsgs++] = msg;
/* Do inner task */
ret = CallWindowProc(s_fnOldImeWndProc, hwnd, uMsg, wParam, lParam);
@ -287,7 +289,8 @@ WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
MD_msgdump(hwnd, uMsg, wParam, lParam);
/* Add message */
s_Msgs[s_cMsgs++] = msg;
if (s_cMsgs < MAX_MSGS)
s_Msgs[s_cMsgs++] = msg;
/* Do inner task */
ret = InnerWindowProc(hwnd, uMsg, wParam, lParam);