Module: wine Branch: refs/heads/master Commit: a963fd62854d66af4c1626836934b6c229eff64f URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=a963fd62854d66af4c162683...
Author: Robert Shearman rob@codeweavers.com Date: Tue Apr 18 11:56:14 2006 +0100
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 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/dlls/oleaut32/usrmarshal.c b/dlls/oleaut32/usrmarshal.c index 961304f..4374348 100644 --- a/dlls/oleaut32/usrmarshal.c +++ b/dlls/oleaut32/usrmarshal.c @@ -462,11 +462,12 @@ unsigned char * WINAPI VARIANT_UserUnmar
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: