From 363516d7c394dac611468942a38567fc97de6a28 Mon Sep 17 00:00:00 2001 From: Roy Shea Date: Mon, 7 Jul 2008 16:13:33 -0700 Subject: [PATCH] wintrust/test: Verify array length before calling memcmp in test. --- dlls/wintrust/tests/crypt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/wintrust/tests/crypt.c b/dlls/wintrust/tests/crypt.c index c28f98cdd05..a45f8531369 100644 --- a/dlls/wintrust/tests/crypt.c +++ b/dlls/wintrust/tests/crypt.c @@ -335,7 +335,9 @@ static void test_calchash(void) { ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError()); - ok(!memcmp(hash, expectedhash, sizeof(expectedhash)), "Hashes didn't match\n"); + ok(hashsize == sizeof(expectedhash) && + !memcmp(hash, expectedhash, sizeof(expectedhash)), + "Hashes didn't match\n"); } CloseHandle(file);