https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e1d3a7d08c3121add0793…
commit e1d3a7d08c3121add079371a93ba77463be574b3
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Fri Oct 21 15:22:06 2022 +0900
Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
CommitDate: Fri Oct 21 15:22:06 2022 +0900
[IMM32] Improve ImmGetCandidateWindow
CORE-11700
---
dll/win32/imm32/candidate.c | 5 ++++-
dll/win32/imm32/utils.c | 1 +
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/dll/win32/imm32/candidate.c b/dll/win32/imm32/candidate.c
index 028d1233fa3..a54d0e8305b 100644
--- a/dll/win32/imm32/candidate.c
+++ b/dll/win32/imm32/candidate.c
@@ -364,8 +364,11 @@ ImmGetCandidateWindow(HIMC hIMC, DWORD dwIndex, LPCANDIDATEFORM
lpCandidate)
TRACE("(%p, %lu, %p)\n", hIMC, dwIndex, lpCandidate);
+ if (dwIndex >= MAX_CANDIDATEFORM) /* Windows didn't check but we do for
security reason */
+ return FALSE;
+
pIC = ImmLockIMC(hIMC);
- if (pIC == NULL)
+ if (pIC == NULL)
return FALSE;
pCF = &pIC->cfCandForm[dwIndex];
diff --git a/dll/win32/imm32/utils.c b/dll/win32/imm32/utils.c
index 1bcbb20823f..bef252b665b 100644
--- a/dll/win32/imm32/utils.c
+++ b/dll/win32/imm32/utils.c
@@ -42,6 +42,7 @@ Imm32UIntToStr(DWORD dwValue, ULONG nBase, LPWSTR pszBuff, USHORT
cchBuff)
return S_OK;
}
+/* Win: CheckCountry */
BOOL APIENTRY Imm32IsSystemJapaneseOrKorean(VOID)
{
LCID lcid = GetSystemDefaultLCID();