From: Timo Sirainen Date: Sun, 4 Aug 2013 09:16:09 +0000 (+0300) Subject: lib-http: Don't crash when receiving 304 or a redirect without Location: header. X-Git-Tag: 2.2.5~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cddbeddaefeff42d731a8b02f74815dfff034d50;p=thirdparty%2Fdovecot%2Fcore.git lib-http: Don't crash when receiving 304 or a redirect without Location: header. Patch by Stephan Bosch --- diff --git a/src/lib-http/http-client-connection.c b/src/lib-http/http-client-connection.c index 648fb622af..7d8e92732c 100644 --- a/src/lib-http/http-client-connection.c +++ b/src/lib-http/http-client-connection.c @@ -590,8 +590,9 @@ static void http_client_connection_input(struct connection *_conn) req->payload_sync = FALSE; conn->peer->no_payload_sync = TRUE; http_client_request_retry(req, response->status, response->reason); - return; - } else if (response->status / 100 == 3) { + return; + } else if (response->status / 100 == 3 && response->status != 304 && + response->location != NULL) { /* redirect */ http_client_request_redirect(req, response->status, response->location); } else {