[PATCH] fixed incorrect MBtoWC

Marcus Meissner marcus at jet.franken.de
Thu Sep 4 12:32:01 CDT 2008


Hi,

Patchwatcher found a failing testcase after my buffer overflow
patch... This is one of the cases it finds easily, a missing
/sizeof(WCHAR).

Ciao, Marcus
---
 dlls/msxml3/tests/saxreader.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/msxml3/tests/saxreader.c b/dlls/msxml3/tests/saxreader.c
index 88cd89f..2865f53 100644
--- a/dlls/msxml3/tests/saxreader.c
+++ b/dlls/msxml3/tests/saxreader.c
@@ -140,7 +140,7 @@ static void test_saxstr(unsigned line, const WCHAR *szStr, int nStr, const char
     if(len != nStr)
         return;
 
-    MultiByteToWideChar(CP_ACP, 0, szTest, -1, buf, sizeof(buf));
+    MultiByteToWideChar(CP_ACP, 0, szTest, -1, buf, sizeof(buf)/sizeof(WCHAR));
     ok_(__FILE__,line) (!memcmp(szStr, buf, len*sizeof(WCHAR)), "unexpected szStr %s, expected %s\n",
                         debugstr_wn(szStr, nStr), szTest);
 }
-- 
1.5.2.4



More information about the wine-patches mailing list