]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: Don't crash when receiving 304 or a redirect without Location: header.
authorTimo Sirainen <tss@iki.fi>
Sun, 4 Aug 2013 09:16:09 +0000 (12:16 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 4 Aug 2013 09:16:09 +0000 (12:16 +0300)
Patch by Stephan Bosch

src/lib-http/http-client-connection.c

index 648fb622afd92e8fff2c58429bab50b98af05144..7d8e92732c02a73baaae65ec04d0965eb7e60e33 100644 (file)
@@ -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 {