mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-25 06:00:40 +01:00
dhcp/nettools: validate proxy-autodiscovery option (252) to not contain any NUL characters
This commit is contained in:
parent
8f7a2a1ea0
commit
eb16cb6563
1 changed files with 6 additions and 1 deletions
|
|
@ -951,7 +951,12 @@ lease_to_ip4_config(NMDedupMultiIndex *multi_idx,
|
|||
NM_DHCP_OPTION_DHCP4_PRIVATE_PROXY_AUTODISCOVERY,
|
||||
&l_data,
|
||||
&l_data_len);
|
||||
if (r == 0) {
|
||||
if (r == 0 && nm_dhcp_lease_data_parse_cstr(l_data, l_data_len, &l_data_len)) {
|
||||
/* https://tools.ietf.org/html/draft-ietf-wrec-wpad-01#section-4.4.1
|
||||
*
|
||||
* We reject NUL characters inside the string (except one trailing NUL).
|
||||
* Otherwise, we allow any encoding and backslash-escape the result to
|
||||
* UTF-8. */
|
||||
nm_dhcp_option_add_option_utf8safe_escape(options,
|
||||
_nm_dhcp_option_dhcp4_options,
|
||||
NM_DHCP_OPTION_DHCP4_PRIVATE_PROXY_AUTODISCOVERY,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue