From: Yann Ylavic Date: Thu, 15 Feb 2018 18:31:25 +0000 (+0000) Subject: mod_cache_socache: Fix caching of empty headers up to carriage return. X-Git-Tag: 2.5.0-alpha2-ci-test-only~2860 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5c2bbc8ccdc7f12914f2bd820b911833fffc696;p=thirdparty%2Fapache%2Fhttpd.git mod_cache_socache: Fix caching of empty headers up to carriage return. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1824343 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 29e43e5df3d..ae7117653d3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.1 + *) mod_cache_socache: Fix caching of empty headers up to carriage return. + [Yann Ylavic] + *) regex: Allow to configure global/default options for regexes, like caseless matching or extended format. [Yann Ylavic] diff --git a/modules/cache/mod_cache_socache.c b/modules/cache/mod_cache_socache.c index 11e950285d3..0d76760c5ba 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