From 8097ab4f0cf7a52ac6ca45cb2b2dfe4850a2dee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 25 Sep 2013 17:52:43 +0200 Subject: test-hashmap: fix access to uninitialized memory --- src/test/test-hashmap.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/test/test-hashmap.c b/src/test/test-hashmap.c index 2aead79bb..2c27d0867 100644 --- a/src/test/test-hashmap.c +++ b/src/test/test-hashmap.c @@ -468,9 +468,11 @@ static void test_hashmap_get(void) { } static void test_uint64_compare_func(void) { - assert_se(uint64_compare_func("a", "a") == 0); - assert_se(uint64_compare_func("a", "b") == -1); - assert_se(uint64_compare_func("b", "a") == 1); + const uint64_t a = 0x100, b = 0x101; + + assert_se(uint64_compare_func(&a, &a) == 0); + assert_se(uint64_compare_func(&a, &b) == -1); + assert_se(uint64_compare_func(&b, &a) == 1); } static void test_trivial_compare_func(void) { -- cgit v1.2.3