From 147a2e3440056ec30d8b386901754a58ea3947d1 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 12 Feb 2009 23:19:45 +0100 Subject: Fix Coverity ID 871 -- do not dereference "sp" before checking for NULL --- source4/lib/socket/socket_ip.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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"; } -- cgit