From: Dan Winship Date: Thu, 13 Aug 2009 22:21:19 +0000 (-0400) Subject: Fix a crash when processing a request with no Host header X-Git-Tag: LIBSOUP_2_27_91~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eb6b12269ec3eea4d1b690f704af15b8cb8acbbe;p=platform%2Fupstream%2Flibsoup.git Fix a crash when processing a request with no Host header Pointed out by Andreas Henriksson on IRC --- diff --git a/libsoup/soup-message-server-io.c b/libsoup/soup-message-server-io.c index 56d2a6b..5903fe2 100644 --- a/libsoup/soup-message-server-io.c +++ b/libsoup/soup-message-server-io.c @@ -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; }