From: Ronan Pigott Date: Mon, 3 Jul 2023 20:02:47 +0000 (-0700) Subject: dhcp6: relax data assert in dhcp6_option_parse_string X-Git-Tag: v254-rc1~44^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46bc8561f0917a16f987126c7754f2bd383fa120;p=thirdparty%2Fsystemd.git dhcp6: relax data assert in dhcp6_option_parse_string dhcp6_option_parse_string is intended to clear strings with length 0, for consistency. The data assert is too strict for this purpose, so we will allow data || data_len == 0, similar to other dhcp6_option_parse* helpers. Fixes: fde788601be8 ("dhcp6-client: parse RFC8910 captive portal dhcp6 option") --- diff --git a/src/libsystemd-network/dhcp6-option.c b/src/libsystemd-network/dhcp6-option.c index 3409485e118..76db8717b23 100644 --- a/src/libsystemd-network/dhcp6-option.c +++ b/src/libsystemd-network/dhcp6-option.c @@ -529,7 +529,7 @@ int dhcp6_option_parse_string(const uint8_t *data, size_t data_len, char **ret) _cleanup_free_ char *string = NULL; int r; - assert(data); + assert(data || data_len == 0); assert(ret); if (data_len <= 0) {