network: accept NUL character in SendOption=

Closes #14609.
This commit is contained in:
Yu Watanabe 2020-01-27 18:11:08 +09:00
parent a6a36dea2d
commit 732e3a6104

View file

@ -390,7 +390,7 @@ int config_parse_dhcp_send_option(
break; break;
} }
case DHCP_OPTION_DATA_STRING: case DHCP_OPTION_DATA_STRING:
sz = cunescape(p, 0, &q); sz = cunescape(p, UNESCAPE_ACCEPT_NUL, &q);
if (sz < 0) { if (sz < 0) {
log_syntax(unit, LOG_ERR, filename, line, sz, log_syntax(unit, LOG_ERR, filename, line, sz,
"Failed to decode DHCPv4 option data, ignoring assignment: %s", p); "Failed to decode DHCPv4 option data, ignoring assignment: %s", p);