mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-08 20:00:23 +01:00
dns: dnsmasq: avoid crash when no reverse domains exist
ip_data->domains.reverse can be NULL when the device is being removed
and has no IP configuration for a short moment.
Fixes: 6409e7719c
https://bugzilla.gnome.org/show_bug.cgi?id=797022
This commit is contained in:
parent
4a1ff8ad8c
commit
f0c075f050
1 changed files with 6 additions and 4 deletions
|
|
@ -183,10 +183,12 @@ add_ip_config (NMDnsDnsmasq *self, GVariantBuilder *servers, const NMDnsIPConfig
|
|||
domain[0] ? domain : NULL);
|
||||
}
|
||||
|
||||
for (j = 0; ip_data->domains.reverse[j]; j++) {
|
||||
add_dnsmasq_nameserver (self, servers,
|
||||
ip_addr_to_string_buf,
|
||||
ip_data->domains.reverse[j]);
|
||||
if (ip_data->domains.reverse) {
|
||||
for (j = 0; ip_data->domains.reverse[j]; j++) {
|
||||
add_dnsmasq_nameserver (self, servers,
|
||||
ip_addr_to_string_buf,
|
||||
ip_data->domains.reverse[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue