summaryrefslogtreecommitdiffstats
path: root/source
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
commita7842fac94a3f772da0e6ddf14044df24af798a9 (patch)
tree991474817671afff21a5cbe1264d17b64f9e9f94 /source
parent6f388502622fe77ae13ac2b0ae8f39b2e77ba455 (diff)
downloadsamba-a7842fac94a3f772da0e6ddf14044df24af798a9.tar.gz
samba-a7842fac94a3f772da0e6ddf14044df24af798a9.tar.xz
samba-a7842fac94a3f772da0e6ddf14044df24af798a9.zip
Make sure that if there are no interfaces, name_register_wins does not
segfault.
Diffstat (limited to 'source')
-rw-r--r--source/libsmb/namequery.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/libsmb/namequery.c b/source/libsmb/namequery.c
index 4a3cf43b357..39159be41ba 100644
--- a/source/libsmb/namequery.c
+++ b/source/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 ...
*/