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 f1ff5fe37c2a7f7a35428be02b3a683034b6c335..a2a0dd2647f820fb17755e35f84eeae2886081e8 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) {