Commit 7279251a authored by Ondřej Surý's avatar Ondřej Surý

Fix some trivial nonnull-attribute errors

parent 79429b15
......@@ -54,7 +54,7 @@ static void test_base64(void)
int r = dnssec_binary_from_base64(&base64, &binary);
ok(r == DNSSEC_EOK &&
binary.size == ts->decoded_size &&
memcmp(binary.data, ts->decoded, binary.size) == 0,
(binary.size == 0 || memcmp(binary.data, ts->decoded, binary.size) == 0),
"dnssec_binary_from_base64() for '%s'", ts->encoded);
dnssec_binary_t encoded = { 0 };
......
......@@ -123,7 +123,7 @@ static void check_option(knot_rdata_t *rdata, uint16_t opt_code,
ok(check, "%s: OPTION data size", msg);
/* Check the actual NSID data. */
check = (memcmp(data + pos + OFFSET_OPT_DATA, opt_data, opt_len)) == 0;
check = (opt_data == 0 || memcmp(data + pos + OFFSET_OPT_DATA, opt_data, opt_len) == 0);
ok(check, "%s: OPTION data", msg);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment