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: fde788601b ("dhcp6-client: parse RFC8910 captive portal dhcp6 option")
This commit is contained in:
Ronan Pigott
2023-07-03 13:02:47 -07:00
parent c470513eea
commit 46bc8561f0

View File

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