Commit 8309a7a6 authored by Beniamino Galvani's avatar Beniamino Galvani

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: 6409e771

https://bugzilla.gnome.org/show_bug.cgi?id=797022
(cherry picked from commit f0c075f0)
parent 5713acfe
......@@ -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]);
}
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment