From dbdc5a2978c847dd918107c7379fb73f88d27a36 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Mon, 31 Dec 2001 20:53:28 +0000 Subject: [PATCH] Prevent mod_proxy from truncating one character off the end of the status line returned from the proxied server. Note that buffer is NULL terminated by the call to ap_proxy_string_read() so there is no need to terminate it again. Submitted by: Adam Sussman Reviewed by: Bill Stoddard git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92692 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ modules/proxy/proxy_http.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 51a986b691..455ed943b0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ Changes with Apache 2.0.30-dev + *) Prevent mod_proxy from truncating one character off the + end of the status line returned from the proxied server. + [Adam Sussman, Bill Stoddard] + *) Eliminate loop in ap_proxy_string_read(). [Adam Sussman, Bill Stoddard] diff --git a/modules/proxy/proxy_http.c b/modules/proxy/proxy_http.c index 4b73b1e81a..e45021c9b2 100644 --- a/modules/proxy/proxy_http.c +++ b/modules/proxy/proxy_http.c @@ -670,6 +670,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, /* Is it an HTTP/1 response? * This is buggy if we ever see an HTTP/1.10 + * XXX: This code is way crufty... */ if (apr_date_checkmask(buffer, "HTTP/#.# ###*")) { int major, minor; @@ -689,7 +690,6 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, "server: ", buffer, NULL)); } backasswards = 0; - buffer[--len] = '\0'; buffer[12] = '\0'; r->status = atoi(&buffer[9]); -- 2.40.0