summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-02-17 21:19:00 +0000
committerJeremy Allison <jra@samba.org>2003-02-17 21:19:00 +0000
commit3fe0de1fcf5ad6d86611e1cc655f9b0663d71da6 (patch)
tree782e4c59c53562fcb841393a03029febd18555f5 /source3
parent585d50c667c78cb1d9e8db3e8f9e51d41fead1d9 (diff)
downloadsamba-3fe0de1fcf5ad6d86611e1cc655f9b0663d71da6.tar.gz
samba-3fe0de1fcf5ad6d86611e1cc655f9b0663d71da6.tar.bz2
samba-3fe0de1fcf5ad6d86611e1cc655f9b0663d71da6.zip
Correctly check for inet_addr fail. Patch from gregor.7@osu.edu.
Jeremy. (This used to be commit 01f6b2694532749807aff1c2e6f338dade2d9b09)
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/namequery.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c
index 342a2a2926..62b94761ad 100644
--- a/source3/libsmb/namequery.c
+++ b/source3/libsmb/namequery.c
@@ -809,8 +809,11 @@ static BOOL internal_resolve_name(const char *name, int name_type,
}
if(is_address) {
/* if it's in the form of an IP address then get the lib to interpret it */
- (*return_iplist)->s_addr = inet_addr(name);
- } else {
+ if (((*return_iplist)->s_addr = inet_addr(name)) == 0xFFFFFFFF ){
+ DEBUG(1,("internal_resolve_name: inet_addr failed on %s\n", name));
+ return False;
+ }
+ } else {
(*return_iplist)->s_addr = allones ? 0xFFFFFFFF : 0;
*return_count = 1;
}