]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
dhcp6: relax data assert in dhcp6_option_parse_string
authorRonan Pigott <ronan@rjp.ie>
Mon, 3 Jul 2023 20:02:47 +0000 (13:02 -0700)
committerRonan Pigott <ronan@rjp.ie>
Mon, 3 Jul 2023 20:07:29 +0000 (13:07 -0700)
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

index 3409485e11845bda29901e9e72a8ec357f2169da..76db8717b2342a0149b7d547fd506d85982fcd15 100644 (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) {