Code

data_test: Fixed access to uninitialized memory.
authorSebastian Harl <sh@tokkee.org>
Fri, 11 Jul 2014 15:47:38 +0000 (17:47 +0200)
committerSebastian Harl <sh@tokkee.org>
Fri, 11 Jul 2014 15:47:38 +0000 (17:47 +0200)
t/unit/core/data_test.c

index 0ce93bced809b379c91513c6bc697c9ddc98ece3..e490a383e5b740f9875a0080abf4fd100da54132 100644 (file)
@@ -37,6 +37,7 @@ START_TEST(test_data)
 
        d2.type = SDB_TYPE_INTEGER;
        d2.data.integer = 4711;
+       memset(&d1, 0, sizeof(d1));
        check = sdb_data_copy(&d1, &d2);
        fail_unless(!check, "sdb_data_copy() = %i; expected: 0", check);
        fail_unless(d1.type == d2.type,