Commit 6b4f43e8 authored by Andrew Eikum's avatar Andrew Eikum Committed by Alexandre Julliard

oleaut32: Don't crash on NULL string arguments.

parent 5bfabee8
......@@ -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);
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment