From fd0101ab61e61c67bc91d35639bad125265da615 Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Tue, 19 Jul 2016 09:46:01 +0200 Subject: [PATCH] msctf: Don't crash on NULL input in EnumLanguageProfiles(). Signed-off-by: Michael Stefaniuc Signed-off-by: Aric Stewart Signed-off-by: Alexandre Julliard --- dlls/msctf/inputprocessor.c | 4 ++++ dlls/msctf/tests/inputprocessor.c | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/dlls/msctf/inputprocessor.c b/dlls/msctf/inputprocessor.c index 0e8ad22bea0..fca78e446df 100644 --- a/dlls/msctf/inputprocessor.c +++ b/dlls/msctf/inputprocessor.c @@ -617,6 +617,10 @@ static HRESULT WINAPI InputProcessorProfiles_EnumLanguageProfiles( { InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface); TRACE("(%p) %x %p\n",This,langid,ppEnum); + + if (!ppEnum) + return E_INVALIDARG; + return EnumTfLanguageProfiles_Constructor(langid, ppEnum); } diff --git a/dlls/msctf/tests/inputprocessor.c b/dlls/msctf/tests/inputprocessor.c index 831e37ac1d2..2096bff539f 100644 --- a/dlls/msctf/tests/inputprocessor.c +++ b/dlls/msctf/tests/inputprocessor.c @@ -973,6 +973,11 @@ static void test_EnumLanguageProfiles(void) { BOOL found = FALSE; IEnumTfLanguageProfiles *ppEnum; + HRESULT hr; + + hr = ITfInputProcessorProfiles_EnumLanguageProfiles(g_ipp, gLangid, NULL); + ok(hr == E_INVALIDARG, "EnumLanguageProfiles failed: %x\n", hr); + if (SUCCEEDED(ITfInputProcessorProfiles_EnumLanguageProfiles(g_ipp,gLangid,&ppEnum))) { TF_LANGUAGEPROFILE profile; -- 2.11.4.GIT