Verified Commit c1dcc259 authored by Beniamino Galvani's avatar Beniamino Galvani Committed by Antonio Cardace

systemd: dhcp6: remove assertions in dhcp6_option_parse_domainname()

Assertions are for programming errors; here the input comes directly
from the DHCP response packet.

https://github.com/systemd/systemd/commit/af710b535b4ceacd0aecec6748a4f8ee57742e99
(cherry picked from commit e2248143)
(cherry picked from commit 555c7e4e)
parent d32148fd
......@@ -539,8 +539,10 @@ int dhcp6_option_parse_domainname(const uint8_t *optval, uint16_t optlen, char *
_cleanup_strv_free_ char **names = NULL;
int r;
assert_return(optlen > 1, -ENODATA);
assert_return(optval[optlen - 1] == '\0', -EINVAL);
if (optlen <= 1)
return -ENODATA;
if (optval[optlen - 1] != '\0')
return -EINVAL;
while (pos < optlen) {
_cleanup_free_ char *ret = NULL;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment