diff options
Diffstat (limited to 'tests/vb2_host_sig_tests.c')
-rw-r--r-- | tests/vb2_host_sig_tests.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/vb2_host_sig_tests.c b/tests/vb2_host_sig_tests.c index 76e128c9..809c7b04 100644 --- a/tests/vb2_host_sig_tests.c +++ b/tests/vb2_host_sig_tests.c @@ -117,8 +117,7 @@ static void sig_tests(const struct alg_combo *combo, c_sig_offs = sizeof(*c) + 24; TEST_SUCC(vb2_sig_size_for_key(&size, prik, NULL), "Sig size"); bufsize = c_sig_offs + size; - buf = malloc(bufsize); - memset(buf, 0, bufsize); + buf = calloc(1, bufsize); memset(buf + sizeof(*c), 0x12, 24); c = (struct vb2_struct_common *)buf; c->total_size = bufsize; @@ -135,8 +134,7 @@ static void sig_tests(const struct alg_combo *combo, /* Multiply sign an object */ TEST_SUCC(vb2_sig_size_for_keys(&size, priks, 2), "Sigs size"); bufsize = c_sig_offs + size; - buf = malloc(bufsize); - memset(buf, 0, bufsize); + buf = calloc(1, bufsize); memset(buf + sizeof(*c), 0x12, 24); c = (struct vb2_struct_common *)buf; c->total_size = bufsize; |