mlang: Check output pointer for NULL.

This commit is contained in:
Detlef Riekenberg 2009-05-29 23:31:44 +02:00 committed by Alexandre Julliard
parent 596f8d67a0
commit 68e1735acf
2 changed files with 7 additions and 0 deletions

View File

@ -2257,6 +2257,8 @@ static HRESULT WINAPI fnIMultiLanguage_GetRfc1766FromLcid(
WCHAR buf[MAX_RFC1766_NAME];
TRACE("%p %04x %p\n", iface, lcid, pbstrRfc1766);
if (!pbstrRfc1766)
return E_INVALIDARG;
if (!lcid_to_rfc1766W( lcid, buf, MAX_RFC1766_NAME ))
{
@ -2812,6 +2814,8 @@ static HRESULT WINAPI fnIMultiLanguage2_GetRfc1766FromLcid(
WCHAR buf[MAX_RFC1766_NAME];
TRACE("%p %04x %p\n", iface, lcid, pbstrRfc1766);
if (!pbstrRfc1766)
return E_INVALIDARG;
if (!lcid_to_rfc1766W( lcid, buf, MAX_RFC1766_NAME ))
{

View File

@ -966,6 +966,9 @@ static void test_GetRfc1766FromLcid(IMultiLanguage2 *iML2)
SysFreeString(rfcstr);
}
hr = IMultiLanguage2_GetRfc1766FromLcid(iML2, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NULL);
ok(hr == E_INVALIDARG, "got 0x%x (expected E_INVALIDARG)\n", hr);
}
static void test_IMultiLanguage2_ConvertStringFromUnicode(IMultiLanguage2 *iML2)