[2/2] msxml3: Reader shouldn't depend on input being properly allocated BSTR string
Nikolay Sivov
nsivov at codeweavers.com
Sun Jun 17 15:51:09 CDT 2012
Another case of broken application string allocation code -
http://bugs.winehq.org/show_bug.cgi?id=24022
-------------- next part --------------
>From 95a0713050b98784bab77c99596da26a50ecd144 Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <nsivov at codeweavers.com>
Date: Sun, 17 Jun 2012 23:51:09 +0400
Subject: [PATCH 2/2] Reader shouldn't depend on input being properly allocated BSTR string
---
dlls/msxml3/saxreader.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/dlls/msxml3/saxreader.c b/dlls/msxml3/saxreader.c
index cf87d98..485644a 100644
--- a/dlls/msxml3/saxreader.c
+++ b/dlls/msxml3/saxreader.c
@@ -2151,6 +2151,8 @@ static HRESULT internal_parseBuffer(saxreader *This, const char *buffer, int siz
saxlocator *locator;
HRESULT hr;
+ TRACE("(%p)->(%p %d)\n", This, buffer, size);
+
hr = SAXLocator_create(This, &locator, vbInterface);
if (FAILED(hr))
return hr;
@@ -2441,7 +2443,7 @@ static HRESULT internal_parse(
{
case VT_BSTR:
hr = internal_parseBuffer(This, (const char*)V_BSTR(&varInput),
- SysStringByteLen(V_BSTR(&varInput)), vbInterface);
+ strlenW(V_BSTR(&varInput))*sizeof(WCHAR), vbInterface);
break;
case VT_ARRAY|VT_UI1: {
void *pSAData;
--
1.5.6.5
More information about the wine-patches
mailing list