From eb6b12269ec3eea4d1b690f704af15b8cb8acbbe Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Thu, 13 Aug 2009 18:21:19 -0400 Subject: [PATCH] Fix a crash when processing a request with no Host header Pointed out by Andreas Henriksson on IRC --- libsoup/soup-message-server-io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.7.4