Fix a wrong length passed to a WideCharToMultiByte test, which =

Colin Finck mail at colinfinck.de
Thu Jul 31 19:49:52 CDT 2008


led to a use of uninitialized stack memory.=0A=
 The test passed anyway, because only the 3 bytes were checked later and =
the destination buffer was large enough to hold 5 characters.=0A=
 Thanks to Dan for providing the valgrind output.=0A=
=0A=
---=0A=
 dlls/kernel32/tests/codepage.c |    4 ++--=0A=
 1 files changed, 2 insertions(+), 2 deletions(-)=0A=
=0A=
diff --git a/dlls/kernel32/tests/codepage.c =
b/dlls/kernel32/tests/codepage.c=0A=
index a20a306..0c5d697 100644=0A=
--- a/dlls/kernel32/tests/codepage.c=0A=
+++ b/dlls/kernel32/tests/codepage.c=0A=
@@ -285,8 +285,8 @@ static void test_string_conversion(LPBOOL =
bUsedDefaultChar)=0A=
     ok(GetLastError() =3D=3D 0xdeadbeef, "GetLastError() is %u\n", =
GetLastError());=0A=
 =0A=
     /* Double-byte tests */=0A=
-    ret =3D WideCharToMultiByte(1252, 0, dbwcs, 5, mbs, sizeof(mbs), =
NULL, bUsedDefaultChar);=0A=
-    ok(ret =3D=3D 5, "ret is %d\n", ret);=0A=
+    ret =3D WideCharToMultiByte(1252, 0, dbwcs, 3, mbs, sizeof(mbs), =
NULL, bUsedDefaultChar);=0A=
+    ok(ret =3D=3D 3, "ret is %d\n", ret);=0A=
     ok(!strcmp(mbs, "??"), "mbs is %s\n", mbs);=0A=
     if(bUsedDefaultChar) ok(*bUsedDefaultChar =3D=3D TRUE, =
"bUsedDefaultChar is %d\n", *bUsedDefaultChar);=0A=
 =0A=
-- =0A=
1.5.6.1.1071.g76fb=0A=
=0A=

------=_NextPart_000_0019_01C8F34A.D18198C0--




More information about the wine-patches mailing list