wintrust/test: Verify array length before calling memcmp in test (RESEND)

Roy Shea royshea at
Mon Jul 7 17:05:55 CDT 2008

This revision uses a more concise check of hash equality than prior
patch archived at:

Call to memcmp in test_calchash assumes length of hash and expectedhash
are the same.  This need not be true in general, and is not true for the
current stub implementation of CryptCATAdminCalcHashFromFileHandle.
This patch adds an explicit test of array length.  In doing so it
prevents the following Valgrind warning:

Conditional jump or move depends on uninitialised value(s)
   at  winetest_vok (test.h:256)
   by  winetest_ok (test.h:301)
   by  test_calchash (crypt.c:338)
   by  func_crypt (crypt.c:359)
   by  run_test (test.h:449)
 dlls/wintrust/tests/crypt.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 6bbf195ca1d61c648167320abfb1d0e16178b299.diff
Type: text/x-patch
Size: 595 bytes
Desc: not available
Url : 

More information about the wine-patches mailing list