[PATCH 1/2] msctf: Don't crash on NULL input in EnumLanguageProfiles().
Aric Stewart
aric at codeweavers.com
Tue Jul 19 14:30:32 CDT 2016
Signed-off-by: Aric Stewart <aric at codeweavers.com>
On 7/19/16 2:46 AM, Michael Stefaniuc wrote:
> Signed-off-by: Michael Stefaniuc <mstefani at redhat.de>
> ---
> 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 0e8ad22..fca78e4 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 831e37a..2096bff 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;
>
More information about the wine-patches
mailing list