Fix a crash when processing a request with no Host header
authorDan Winship <danw@gnome.org>
Thu, 13 Aug 2009 22:21:19 +0000 (18:21 -0400)
committerDan Winship <danw@gnome.org>
Thu, 13 Aug 2009 22:21:19 +0000 (18:21 -0400)
Pointed out by Andreas Henriksson on IRC

libsoup/soup-message-server-io.c

index 56d2a6b..5903fe2 100644 (file)
@@ -56,7 +56,7 @@ parse_request_headers (SoupMessage *msg, char *headers, guint headers_len,
 
        /* Generate correct context for request */
        req_host = soup_message_headers_get_one (msg->request_headers, "Host");
-       if (strchr (req_host, '/')) {
+       if (req_host && strchr (req_host, '/')) {
                g_free (req_path);
                return SOUP_STATUS_BAD_REQUEST;
        }