mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-11 07:30:16 +01:00
dhcp/nettools: fix crash with empty DHCP option 40 (NIS domain name)
nm_utils_buf_utf8safe_escape() returns NULL for an empty string.
Fixes: 6c8a9e8bd6 ('dhcp/nettools: validate nis-domain option (40) differently')
This commit is contained in:
parent
bf9fab47ad
commit
2d0ac5f5fe
1 changed files with 2 additions and 2 deletions
|
|
@ -696,8 +696,8 @@ lease_to_ip4_config(NMDedupMultiIndex *multi_idx,
|
|||
|
||||
v_str = nm_utils_buf_utf8safe_escape((char *) l_data, l_data_len, 0, &to_free);
|
||||
|
||||
nm_dhcp_option_add_option(options, AF_INET, NM_DHCP_OPTION_DHCP4_NIS_DOMAIN, v_str);
|
||||
nm_ip4_config_set_nis_domain(ip4_config, v_str);
|
||||
nm_dhcp_option_add_option(options, AF_INET, NM_DHCP_OPTION_DHCP4_NIS_DOMAIN, v_str ?: "");
|
||||
nm_ip4_config_set_nis_domain(ip4_config, v_str ?: "");
|
||||
}
|
||||
|
||||
lease_parse_address_list(lease, ip4_config, NM_DHCP_OPTION_DHCP4_NIS_SERVERS, options, &sbuf);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue