msctf: Don't crash on NULL input in EnumLanguageProfiles().

Signed-off-by: Michael Stefaniuc <mstefani@redhat.de>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2016-07-19 09:46:01 +02:00 committed by Alexandre Julliard
parent a711285137
commit fd0101ab61
2 changed files with 9 additions and 0 deletions

View File

@ -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);
}

View File

@ -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;