From: Volker Lendecke Date: Thu, 12 Feb 2009 22:19:45 +0000 (+0100) Subject: Fix Coverity ID 871 -- do not dereference "sp" before checking for NULL X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=147a2e3440056ec30d8b386901754a58ea3947d1;p=mat%2Fsamba.git Fix Coverity ID 871 -- do not dereference "sp" before checking for NULL --- 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"; }