avoid crash if hostserv is with host part only
[openssl.git] / 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) {