diff options
author | Richard Sharpe <sharpe@samba.org> | 2001-09-09 09:59:33 +0000 |
---|---|---|
committer | Richard Sharpe <sharpe@samba.org> | 2001-09-09 09:59:33 +0000 |
commit | a7842fac94a3f772da0e6ddf14044df24af798a9 (patch) | |
tree | 991474817671afff21a5cbe1264d17b64f9e9f94 /source | |
parent | 6f388502622fe77ae13ac2b0ae8f39b2e77ba455 (diff) | |
download | samba-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.c | 7 |
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 ... */ |