r22157: Fix bug #3634 - stop nmbd segfaulting with bad interface line.
authorJeremy Allison <jra@samba.org>
Tue, 10 Apr 2007 20:35:30 +0000 (20:35 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:19:17 +0000 (12:19 -0500)
Jeremy.

source/nmbd/nmbd_subnetdb.c

index 04df3e9a4f9e07257ab9fa26cc1ab7dbe6c5a19d..4b04751235d8dda94c37a643b604ecf04f8b0c04 100644 (file)
@@ -223,6 +223,13 @@ BOOL create_subnets(void)
                        return False;
        }
 
+        /* We must have at least one subnet. */
+       if (subnetlist == NULL) {
+               DEBUG(0,("create_subnets: unable to create any subnet from "
+                               "given interfaces. nmbd is terminating\n"));
+               return False;
+       }
+
        if (lp_we_are_a_wins_server()) {
                /* Pick the first interface ip address as the WINS server ip. */
                struct in_addr *nip = iface_n_ip(0);