From b6666cba2c790927f4e6c609553c964f8abccfd2 Mon Sep 17 00:00:00 2001 From: Robert Butts Date: Thu, 14 Jan 2021 15:28:35 -0700 Subject: [PATCH] Fix parent connect fail segfault --- proxy/http/HttpTransact.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc index ea38992e569..e486004a064 100644 --- a/proxy/http/HttpTransact.cc +++ b/proxy/http/HttpTransact.cc @@ -380,6 +380,10 @@ response_is_retryable(HttpTransact::State *s, HTTPStatus response_code) inline static void simple_or_unavailable_server_retry(HttpTransact::State *s) { + if (!HttpTransact::is_response_valid(s, &s->hdr_info.server_response)) { + return; // must return now if the response isn't valid, before calling http_hdr_status_get on uninitialized data + } + HTTPStatus server_response = http_hdr_status_get(s->hdr_info.server_response.m_http); switch (response_is_retryable(s, server_response)) { case PARENT_RETRY_SIMPLE: