From 704dffcb097acc3b9cc8adc7a0ac20eaa4b6670b Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Tue, 11 Jul 2006 23:47:59 +0900 Subject: [PATCH] ole32: Allocate copied VT_CF data correctly in PropVariantCopy. --- dlls/ole32/ole2.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/ole32/ole2.c b/dlls/ole32/ole2.c index 1e890f9eb3d..3a8be57b5ae 100644 --- a/dlls/ole32/ole2.c +++ b/dlls/ole32/ole2.c @@ -2699,6 +2699,9 @@ HRESULT WINAPI PropVariantCopy(PROPVARIANT *pvarDest, /* [out] */ if (pvarSrc->u.pclipdata) { len = pvarSrc->u.pclipdata->cbSize - sizeof(pvarSrc->u.pclipdata->ulClipFmt); + pvarDest->u.pclipdata = CoTaskMemAlloc(sizeof (CLIPDATA)); + pvarDest->u.pclipdata->cbSize = pvarSrc->u.pclipdata->cbSize; + pvarDest->u.pclipdata->ulClipFmt = pvarSrc->u.pclipdata->ulClipFmt; pvarDest->u.pclipdata->pClipData = CoTaskMemAlloc(len); CopyMemory(pvarDest->u.pclipdata->pClipData, pvarSrc->u.pclipdata->pClipData, len); }