msctf: fully clear the Variant before setting it.

Huw Davies huw at codeweavers.com
Wed Jul 1 12:10:09 CDT 2009


On Wed, Jul 01, 2009 at 10:29:22AM -0500, Aric Stewart wrote:
> diff --git a/dlls/msctf/compartmentmgr.c b/dlls/msctf/compartmentmgr.c
> index 3afcfda..e1c7187 100644
> --- a/dlls/msctf/compartmentmgr.c
> +++ b/dlls/msctf/compartmentmgr.c
> @@ -537,6 +537,7 @@ static HRESULT WINAPI Compartment_GetValue(ITfCompartment *iface,
>      if (!pvarValue)
>          return E_INVALIDARG;
>  
> +    memset(pvarValue,0,sizeof(VARIANT));
>      pvarValue->n1.n2.vt = VT_EMPTY;
>      if (!This->variant.n1.n2.vt == VT_EMPTY)
>          hr = VariantCopy(pvarValue,&This->variant);
> 


This looks wrong; there's something strange going on here.  Note also
there's VariantInit() which is a cleaner way to set vt to VT_EMPTY.

Huw.



More information about the wine-devel mailing list