From a963fd62854d66af4c1626836934b6c229eff64f Mon Sep 17 00:00:00 2001 From: Robert Shearman Date: Tue, 18 Apr 2006 11:56:14 +0100 Subject: [PATCH] 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. --- dlls/oleaut32/usrmarshal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/oleaut32/usrmarshal.c b/dlls/oleaut32/usrmarshal.c index 961304f7811..4374348ed1b 100644 --- a/dlls/oleaut32/usrmarshal.c +++ b/dlls/oleaut32/usrmarshal.c @@ -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: -- 2.11.4.GIT