1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-25 01:34:28 +03:00

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
This commit is contained in:
Luca Boccassi 2021-03-25 11:47:13 +00:00
parent c0ef415862
commit 7489d0640a

View File

@ -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);