network/dhcp: actually refuse to assign DHCP option when an invalid string is passed
Prompted by #30029.
This commit is contained in:
committed by
Luca Boccassi
parent
67df554047
commit
fbf946ce22
@@ -1014,9 +1014,11 @@ int config_parse_dhcp_send_option(
|
||||
}
|
||||
case DHCP_OPTION_DATA_STRING:
|
||||
sz = cunescape(p, UNESCAPE_ACCEPT_NUL, &q);
|
||||
if (sz < 0)
|
||||
if (sz < 0) {
|
||||
log_syntax(unit, LOG_WARNING, filename, line, sz,
|
||||
"Failed to decode DHCP option data, ignoring assignment: %s", p);
|
||||
return 0;
|
||||
}
|
||||
|
||||
udata = q;
|
||||
break;
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
[DHCPv6]
|
||||
SendOption=1:string:\U
|
||||
SendVendorOption=123:1:string:\U
|
||||
[DHCPv4]
|
||||
SendOption=1:string:\U
|
||||
Reference in New Issue
Block a user