[PATCH 0/1] MR8295: msi/tests: Fix out-of-bound memcmp.
If the sizes of the registry values already diff, don't call memcmp on them. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/8295
From: Yuxuan Shui <yshui(a)codeweavers.com> If the sizes of the registry values already diff, don't call memcmp on them. --- dlls/msi/tests/action.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/msi/tests/action.c b/dlls/msi/tests/action.c index 47ccef33733..a96561e58b3 100644 --- a/dlls/msi/tests/action.c +++ b/dlls/msi/tests/action.c @@ -2468,7 +2468,7 @@ static void check_reg_multi(HKEY prodkey, const char *name, const char *expect, ok_(__FILE__, line)(!res, "Failed to query value, error %ld\n", res); ok_(__FILE__, line)(type == REG_MULTI_SZ, "Got wrong type %lu\n", type); ok_(__FILE__, line)(size == expect_size, "expected size %lu, got %lu\n", expect_size, size); - ok_(__FILE__, line)(!memcmp(val, expect, size), "got %s\n", debugstr_an(val, size)); + ok_(__FILE__, line)(size == expect_size && !memcmp(val, expect, size), "got %s\n", debugstr_an(val, size)); } static void check_reg_dword(HKEY prodkey, LPCSTR name, DWORD expected, BOOL todo, DWORD line) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/8295
This merge request was approved by Hans Leidekker. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/8295
participants (3)
-
Hans Leidekker (@hans) -
Yuxuan Shui -
Yuxuan Shui (@yshui)