From 46bc8561f0917a16f987126c7754f2bd383fa120 Mon Sep 17 00:00:00 2001 From: Ronan Pigott Date: Mon, 3 Jul 2023 13:02:47 -0700 Subject: [PATCH] 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") --- src/libsystemd-network/dhcp6-option.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) { -- 2.47.3