summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sharpe <sharpe@samba.org>2001-09-09 09:59:33 +0000
committerRichard Sharpe <sharpe@samba.org>2001-09-09 09:59:33 +0000
commitba8e3e03432ee7649a3f59ba8b37edbb32c34190 (patch)
tree9ea98046c98e2f8a3b1d022ca2beecfafa732349
parent0366f1d4bcacda61e3be578a9989d2807de28ba1 (diff)
downloadsamba-ba8e3e03432ee7649a3f59ba8b37edbb32c34190.tar.gz
samba-ba8e3e03432ee7649a3f59ba8b37edbb32c34190.tar.bz2
samba-ba8e3e03432ee7649a3f59ba8b37edbb32c34190.zip
Make sure that if there are no interfaces, name_register_wins does not
segfault. (This used to be commit a7842fac94a3f772da0e6ddf14044df24af798a9)
-rw-r--r--source3/libsmb/namequery.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c
index 4a3cf43b35..39159be41b 100644
--- a/source3/libsmb/namequery.c
+++ b/source3/libsmb/namequery.c
@@ -560,6 +560,13 @@ BOOL name_register_wins(const char *name, int name_type)
int num_interfaces = iface_count();
struct in_addr sendto_ip;
+ /*
+ * Check if we have any interfaces, prevents a segfault later
+ */
+
+ if (num_interfaces <= 0)
+ return False; /* Should return some indication of the problem */
+
/*
* Do a broadcast register ...
*/