Module: wine Branch: master Commit: 7c05c62419d33d5eaf339a67e8aa15262e26d049 URL: http://source.winehq.org/git/wine.git/?a=commit;h=7c05c62419d33d5eaf339a67e8...
Author: Hans Leidekker hans@codeweavers.com Date: Wed Oct 21 13:17:24 2009 +0200
mscms/tests: Avoid accessing uninitialized memory.
Found by valgrind.
---
dlls/mscms/tests/profile.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/mscms/tests/profile.c b/dlls/mscms/tests/profile.c index 470e10e..91ae97a 100644 --- a/dlls/mscms/tests/profile.c +++ b/dlls/mscms/tests/profile.c @@ -593,10 +593,13 @@ static void test_GetStandardColorSpaceProfileW(void)
SetLastError(0xfaceabee); /* maybe 2nd param. */ ret = pGetStandardColorSpaceProfileW(NULL, 0, newprofile, &sizeP); - WideCharToMultiByte(CP_ACP, 0, newprofile, -1, newprofileA, sizeof(newprofileA), NULL, NULL); if (!ret) ok( GetLastError() == ERROR_FILE_NOT_FOUND, "GetStandardColorSpaceProfileW() returns %d (GLE=%d)\n", ret, GetLastError() ); - else ok( !lstrcmpiA( newprofileA, empty ) && GetLastError() == 0xfaceabee, + else + { + WideCharToMultiByte(CP_ACP, 0, newprofile, -1, newprofileA, sizeof(newprofileA), NULL, NULL); + ok( !lstrcmpiA( newprofileA, empty ) && GetLastError() == 0xfaceabee, "GetStandardColorSpaceProfileW() returns %d (GLE=%d)\n", ret, GetLastError() ); + }
/* Functional checks */