summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@microsoft.com>2021-03-25 19:33:58 +0000
committerGitHub <noreply@github.com>2021-03-25 19:33:58 +0000
commit6f4c93259e4fbe0ba92c525259fb3b964a82c982 (patch)
treea35605a5261ed924cf9bb918a137d8ab134b4738
parent8640566ac41447e07bb8b4e990626a17b183c80c (diff)
parent7489d0640a4864d4b47fd8fda77f8eb7cf2e3fe8 (diff)
downloadsystemd-6f4c93259e4fbe0ba92c525259fb3b964a82c982.tar.gz
Merge pull request #19117 from bluca/coverity
Two small coverity issues
-rw-r--r--src/libsystemd-network/test-dhcp6-client.c1
-rw-r--r--src/test/test-firewall-util.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/src/libsystemd-network/test-dhcp6-client.c b/src/libsystemd-network/test-dhcp6-client.c
index cb363b3973..42cd91e0be 100644
--- a/src/libsystemd-network/test-dhcp6-client.c
+++ b/src/libsystemd-network/test-dhcp6-client.c
@@ -449,6 +449,7 @@ static int test_advertise_option(sd_event *e) {
case SD_DHCP6_OPTION_IA_NA:
assert_se(optlen == 94);
+ assert_se(optval == &msg_advertise[26]);
assert_se(!memcmp(optval, &msg_advertise[26], optlen));
val = htobe32(0x0ecfa37d);
diff --git a/src/test/test-firewall-util.c b/src/test/test-firewall-util.c
index abc28d500d..dfde01a678 100644
--- a/src/test/test-firewall-util.c
+++ b/src/test/test-firewall-util.c
@@ -14,6 +14,8 @@ static void test_v6(FirewallContext *ctx) {
uint8_t prefixlen;
int r;
+ assert_se(ctx);
+
log_info("/* %s(backend=%s) */", __func__, firewall_backend_to_string(ctx->backend));
if (!socket_ipv6_is_supported())
@@ -46,6 +48,7 @@ static void test_v6(FirewallContext *ctx) {
static union in_addr_union *parse_addr(const char *str, union in_addr_union *u) {
assert(str);
+ assert(u);
assert_se(in_addr_from_string(AF_INET, str, u) >= 0);
return u;
}
@@ -54,6 +57,8 @@ static bool test_v4(FirewallContext *ctx) {
union in_addr_union u, v;
int r;
+ assert_se(ctx);
+
log_info("/* %s(backend=%s) */", __func__, firewall_backend_to_string(ctx->backend));
assert_se(fw_add_masquerade(&ctx, true, AF_INET, NULL, 0) == -EINVAL);
@@ -92,6 +97,7 @@ int main(int argc, char *argv[]) {
return log_tests_skipped("not root");
assert_se(fw_ctx_new(&ctx) >= 0);
+ assert_se(ctx);
if (ctx->backend == FW_BACKEND_NONE)
return EXIT_TEST_SKIP;