summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-02-17 21:19:09 +0000
committerJeremy Allison <jra@samba.org>2003-02-17 21:19:09 +0000
commit21e7ce38ab57bbc9186ec1c155f21f075594a915 (patch)
tree840bf32d12e3ac25ab896bc9c79d840521f7d99c
parent0cf080f719c971ea9be5eb363a7e078e52d101f7 (diff)
downloadsamba-21e7ce38ab57bbc9186ec1c155f21f075594a915.tar.gz
samba-21e7ce38ab57bbc9186ec1c155f21f075594a915.tar.bz2
samba-21e7ce38ab57bbc9186ec1c155f21f075594a915.zip
Correctly check for inet_addr fail. Patch from gregor.7@osu.edu.
Jeremy. (This used to be commit fb3548e5080812c037c2c134504cc9af4ecbfedd)
-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;
}