avoid crash if hostserv is with host part only
authorRoumen Petrov <openssl@roumenpetrov.info>
Sat, 6 Feb 2016 12:07:39 +0000 (14:07 +0200)
committerRichard Levitte <levitte@openssl.org>
Mon, 8 Feb 2016 14:41:36 +0000 (15:41 +0100)
(if priority is set to host)

Signed-off-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
crypto/bio/b_addr.c

index f1ff5fe..a2a0dd2 100644 (file)
@@ -505,7 +505,7 @@ int BIO_parse_hostserv(const char *hostserv, char **host, char **service,
         }
     }
 
-    if (strchr(p, ':'))
+    if (p != NULL && strchr(p, ':'))
         goto spec_err;
 
     if (h != NULL && host != NULL) {