mlang/tests: don't assume output of ConvertStringFromUnicode is null terminated

Dan Kegel dank at kegel.com
Sun Jul 6 10:08:36 CDT 2008


The mlang test assumed that the output of ConvertStringFromUnicode
was null terminated, but it seems not to be.

Fixes the valgrind warning:
Conditional jump or move depends on uninitialised value(s)
   at strlen (mc_replace_strmem.c:242)
   by lstrlenA (string.c:364)
   by ConvertINetMultiByteToUnicode (mlang.c:526)
   by ConvertINetString (mlang.c:633)
   by fnIMultiLanguage2_ConvertString (mlang.c:2197)
   by check_convertible (mlang.c:287)
   by test_EnumCodePages (mlang.c:407)
 Uninitialised value was created by a stack allocation
   at check_convertible (mlang.c:270)

I believe James was trying to fix this with
http://www.winehq.org/pipermail/wine-patches/2008-June/056454.html
but missed (he thought the problem was on the destination
len, but really it was on the source len?).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mlang-tests-strlen.patch
Type: text/x-diff
Size: 500 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20080706/b447971d/attachment.patch 


More information about the wine-patches mailing list