diff options
author | Volker Lendecke <vl@samba.org> | 2009-02-12 23:19:45 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2009-02-12 23:20:20 +0100 |
commit | 147a2e3440056ec30d8b386901754a58ea3947d1 (patch) | |
tree | 335afda858a62f16d08a582f5295de7f23c6c3ee /source4 | |
parent | d75fe9b3934d9c8e0c2bbeb8d0a27deb0b2eb58a (diff) | |
download | samba-147a2e3440056ec30d8b386901754a58ea3947d1.tar.gz samba-147a2e3440056ec30d8b386901754a58ea3947d1.tar.bz2 samba-147a2e3440056ec30d8b386901754a58ea3947d1.zip |
Fix Coverity ID 871 -- do not dereference "sp" before checking for NULL
Diffstat (limited to 'source4')
-rw-r--r-- | source4/lib/socket/socket_ip.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source4/lib/socket/socket_ip.c b/source4/lib/socket/socket_ip.c index cdb75fe021..89b310a23a 100644 --- a/source4/lib/socket/socket_ip.c +++ b/source4/lib/socket/socket_ip.c @@ -552,11 +552,13 @@ static struct in6_addr interpret_addr6(const char *name) char addr[INET6_ADDRSTRLEN]; struct in6_addr dest6; const char *sp = name; - char *p = strchr_m(sp, '%'); + char *p; int ret; if (sp == NULL) return in6addr_any; + p = strchr_m(sp, '%'); + if (strcasecmp(sp, "localhost") == 0) { sp = "::1"; } |