diff --git a/mod_websocket.c b/mod_websocket.c index a487eac..fc1081a 100644 --- a/mod_websocket.c +++ b/mod_websocket.c @@ -932,7 +932,7 @@ static const char *construct_request_origin(request_rec *r) const char *hostname = r->hostname; apr_port_t port = ap_get_server_port(r); - if (ap_strchr_c(hostname, ':')) { + if ((hostname!=NULL)&&(ap_strchr_c(hostname, ':'))) { /* IPv6 hostnames need to be bracketed. */ hostname = apr_pstrcat(r->pool, "[", hostname, "]", NULL); }