summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@sernet.de>2007-10-13 16:27:52 +0200
committerVolker Lendecke <vl@sernet.de>2007-10-13 21:44:58 +0200
commit3d89bad41f64906f42616b50170f3471003139f7 (patch)
tree8afefa1fa6fc0535d31b063b4a87d5bf9999301a
parente8b83d79b129c4928220dee2b191e175172341f6 (diff)
downloadsamba-3d89bad41f64906f42616b50170f3471003139f7.tar.gz
samba-3d89bad41f64906f42616b50170f3471003139f7.tar.bz2
samba-3d89bad41f64906f42616b50170f3471003139f7.zip
Fix a segfault with an unknown interface
"interfaces = foo" with "foo" not being a known interface segfaulted for me. (This used to be commit 556c33702ce6d6c7cde43ddfe965c78ebc2963d3)
-rw-r--r--source3/lib/interface.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source3/lib/interface.c b/source3/lib/interface.c
index 1471a06f46..2eaadab0ec 100644
--- a/source3/lib/interface.c
+++ b/source3/lib/interface.c
@@ -460,7 +460,13 @@ static void interpret_interface(char *token)
/* maybe it is a DNS name */
p = strchr_m(token,'/');
- if (!p && interpret_string_addr(&ss, token)) {
+ if (p == NULL) {
+ if (!interpret_string_addr(&ss, token)) {
+ DEBUG(2, ("interpret_interface: Can't find address "
+ "for %s\n", token));
+ return;
+ }
+
for (i=0;i<total_probed;i++) {
if (addr_equal(&ss, &probed_ifaces[i].ip)) {
add_interface(&probed_ifaces[i]);