oleaut32: Initialise BSTR pointer to NULL in VARIANT_UserUnmarshal.

Initialise BSTR pointer to NULL before calling BSTR_UserUnmarshal,
otherwise BSTR_UserUnmarshal will try to use the memory in the
pointer.
This commit is contained in:
Robert Shearman 2006-04-18 11:56:14 +01:00 committed by Alexandre Julliard
parent 7ca82cd6d2
commit a963fd6285
1 changed files with 2 additions and 1 deletions

View File

@ -462,11 +462,12 @@ unsigned char * WINAPI VARIANT_UserUnmarshal(unsigned long *pFlags, unsigned cha
switch (var->vt) {
case VT_BSTR:
V_BSTR(pvar) = NULL;
Pos = BSTR_UserUnmarshal(pFlags, Pos, &V_BSTR(pvar));
break;
case VT_BSTR | VT_BYREF:
pvar->n1.n2.n3.byref = CoTaskMemAlloc(sizeof(BSTR));
*(BSTR*)pvar->n1.n2.n3.byref = NULL;
*(BSTR*)V_BYREF(pvar) = NULL;
Pos = BSTR_UserUnmarshal(pFlags, Pos, V_BSTRREF(pvar));
break;
case VT_VARIANT | VT_BYREF: