summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-09-25 17:52:43 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-09-26 11:12:03 +0200
commit8097ab4f0cf7a52ac6ca45cb2b2dfe4850a2dee5 (patch)
tree76bc60f642a6070fdb916052f4720f164932dbb8 /src
parentf546241b6dd82d20ff915f618d143a19db8a4574 (diff)
test-hashmap: fix access to uninitialized memory
Diffstat (limited to 'src')
-rw-r--r--src/test/test-hashmap.c8
1 files 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) {