oleaut32: Don't crash on NULL string arguments.

This commit is contained in:
Andrew Eikum 2013-09-10 08:45:41 -05:00 committed by Alexandre Julliard
parent 5bfabee8cd
commit 6b4f43e8e6
2 changed files with 14 additions and 0 deletions

View File

@ -4243,6 +4243,8 @@ static void test_SetFuncAndParamNames(void)
static OLECHAR nameW[] = {'n','a','m','e',0};
static OLECHAR prop[] = {'p','r','o','p',0};
static OLECHAR *propW[] = {prop};
static OLECHAR func[] = {'f','u','n','c',0};
static OLECHAR *funcW[] = {func, NULL};
CHAR filenameA[MAX_PATH];
WCHAR filenameW[MAX_PATH];
ICreateTypeLib2 *ctl;
@ -4309,6 +4311,15 @@ static void test_SetFuncAndParamNames(void)
hr = ICreateTypeInfo_SetFuncAndParamNames(cti, 3, propW, 1);
ok(hr == TYPE_E_AMBIGUOUSNAME, "got 0x%08x\n", hr);
/* regular function */
funcdesc.invkind = INVOKE_FUNC;
funcdesc.cParams = 1;
hr = ICreateTypeInfo_AddFuncDesc(cti, 4, &funcdesc);
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = ICreateTypeInfo_SetFuncAndParamNames(cti, 4, funcW, 2);
ok(hr == S_OK, "got 0x%08x\n", hr);
ICreateTypeInfo_Release(cti);
ICreateTypeLib2_Release(ctl);
DeleteFileA(filenameA);

View File

@ -1889,6 +1889,9 @@ static TLBString *TLB_append_str(struct list *string_list, BSTR new_str)
{
TLBString *str;
if(!new_str)
return NULL;
LIST_FOR_EACH_ENTRY(str, string_list, TLBString, entry) {
if (strcmpW(str->str, new_str) == 0)
return str;