Andrew Eikum : oleaut32: Don't crash on NULL string arguments.
Alexandre Julliard
julliard at winehq.org
Tue Sep 10 14:49:56 CDT 2013
Module: wine
Branch: master
Commit: 6b4f43e8e6c904319033ff2c1748d7394d9d45a5
URL: http://source.winehq.org/git/wine.git/?a=commit;h=6b4f43e8e6c904319033ff2c1748d7394d9d45a5
Author: Andrew Eikum <aeikum at codeweavers.com>
Date: Tue Sep 10 08:45:41 2013 -0500
oleaut32: Don't crash on NULL string arguments.
---
dlls/oleaut32/tests/typelib.c | 11 +++++++++++
dlls/oleaut32/typelib.c | 3 +++
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c
index 1c398f9..17a3b99 100644
--- a/dlls/oleaut32/tests/typelib.c
+++ b/dlls/oleaut32/tests/typelib.c
@@ -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);
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index 328e28a..afcdc5c 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -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;
More information about the wine-cvs
mailing list