From c327f16fbb61f80bf6888794db7a15760f9f0546 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Fri, 16 Feb 2018 13:34:35 +0000 Subject: *) mod_cache_socache: Fix caching of empty headers up to carriage return. trunk patch: http://svn.apache.org/r1824343 2.4.x patch: trunk works (modulo CHANGES) +1: ylavic, rpluem, minfrin git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1824475 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ STATUS | 4 ---- modules/cache/mod_cache_socache.c | 3 ++- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index edcf422001..14b8cc6eb5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.4.30 + *) mod_cache_socache: Fix caching of empty headers up to carriage return. + [Yann Ylavic] + *) core: For consistency, ensure that read lines are NUL terminated on any error, not only on buffer full. [Yann Ylavic] diff --git a/STATUS b/STATUS index ff3bcaea8d..9ec4ff6acf 100644 --- a/STATUS +++ b/STATUS @@ -118,10 +118,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - *) mod_cache_socache: Fix caching of empty headers up to carriage return. - trunk patch: http://svn.apache.org/r1824343 - 2.4.x patch: trunk works (modulo CHANGES) - +1: ylavic, rpluem, minfrin PATCHES PROPOSED TO BACKPORT FROM TRUNK: diff --git a/modules/cache/mod_cache_socache.c b/modules/cache/mod_cache_socache.c index 11e950285d..0d76760c5b 100644 --- a/modules/cache/mod_cache_socache.c +++ b/modules/cache/mod_cache_socache.c @@ -213,7 +213,8 @@ static apr_status_t read_table(cache_handle_t *handle, request_rec *r, "Premature end of cache headers."); return APR_EGENERAL; } - while (apr_isspace(buffer[colon])) { + /* Do not go past the \r from above as apr_isspace('\r') is true */ + while (apr_isspace(buffer[colon]) && (colon < *slider)) { colon++; } apr_table_addn(table, apr_pstrndup(r->pool, (const char *) buffer -- cgit v1.2.1