From: Luca Boccassi Date: Thu, 25 Mar 2021 11:47:13 +0000 (+0000) Subject: test-dhcp6-client: add one more assert on memory mapping X-Git-Tag: v248-2~18^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F19117%2Fhead;p=thirdparty%2Fsystemd.git test-dhcp6-client: add one more assert on memory mapping Static analyzers need a hint that optval is not pointing off the end of the msg_advertise array, since pos can go up to the full length of it. The array is manually constructed so we know this won't happen, but adding one more assert should be enough to avoid false positives. Coverity CID #1394277 --- diff --git a/src/libsystemd-network/test-dhcp6-client.c b/src/libsystemd-network/test-dhcp6-client.c index cb363b3973f..42cd91e0be3 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);