Commit efe2ee56 authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

mlang/tests: Protect from 1 byte static buffer overflow.

parent 3f726d31
...@@ -86,8 +86,11 @@ static void test_multibyte_to_unicode_translations(IMultiLanguage2 *iML2) ...@@ -86,8 +86,11 @@ static void test_multibyte_to_unicode_translations(IMultiLanguage2 *iML2)
ok(ret == S_OK, "IMultiLanguage2_ConvertStringToUnicode failed: %08x\n", ret); ok(ret == S_OK, "IMultiLanguage2_ConvertStringToUnicode failed: %08x\n", ret);
ok(lenA == lstrlenA(stringA), "expected lenA %u, got %u\n", lstrlenA(stringA), lenA); ok(lenA == lstrlenA(stringA), "expected lenA %u, got %u\n", lstrlenA(stringA), lenA);
ok(lenW == lstrlenW(stringW), "expected lenW %u, got %u\n", lstrlenW(stringW), lenW); ok(lenW == lstrlenW(stringW), "expected lenW %u, got %u\n", lstrlenW(stringW), lenW);
ok(bufW[lenW] != 0, "buf should not be 0 terminated\n"); if (lenW < sizeof(bufW)/sizeof(bufW[0])) {
bufW[lenW] = 0; /* -1 doesn't include 0 terminator */ /* can only happen if the convert call fails */
ok(bufW[lenW] != 0, "buf should not be 0 terminated\n");
bufW[lenW] = 0; /* -1 doesn't include 0 terminator */
}
ok(!lstrcmpW(bufW, stringW), "bufW/stringW mismatch\n"); ok(!lstrcmpW(bufW, stringW), "bufW/stringW mismatch\n");
memset(bufW, 'x', sizeof(bufW)); memset(bufW, 'x', sizeof(bufW));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment