Don't segfault when no browse domains are configured in resolv.conf. Original patch...
authorLennart Poettering <lennart@poettering.net>
Sat, 25 Aug 2007 23:25:19 +0000 (23:25 +0000)
committerLennart Poettering <lennart@poettering.net>
Sat, 25 Aug 2007 23:25:19 +0000 (23:25 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1525 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-daemon/main.c

index 7f796ca..42b3221 100644 (file)
@@ -317,6 +317,11 @@ static void update_browse_domains(void) {
     int n;
     char **p;
 
+    if (!resolv_conf_search_domains) {
+        avahi_server_set_browse_domains(avahi_server, NULL);
+        return;
+    }
+
     l = avahi_string_list_copy(config.server_config.browse_domains);
     
     for (p = resolv_conf_search_domains, n = 0; *p && n < BROWSE_DOMAINS_MAX; p++, n++) {