From 6c9a80c92dddb8954071ec6f4bbb3d5ecc347b87 Mon Sep 17 00:00:00 2001 From: "Paul J. Reder" Date: Tue, 17 Dec 2002 15:29:02 +0000 Subject: [PATCH] mod_cache: Fix PR 15113, a core dump in cache_in_filter when a redirect occurs. The code was passing a format string and integer to apr_pstrcat. Changed to apr_psprintf. [Paul J. Reder] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97970 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ modules/experimental/mod_cache.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index c54a717631..01f89d28f1 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,11 @@ Changes with Apache 2.1.0-dev [Remove entries to the current 2.0 section below, when backported] + *) mod_cache: Fix PR 15113, a core dump in cache_in_filter when + a redirect occurs. The code was passing a format string and + integer to apr_pstrcat. Changed to apr_psprintf. + [Paul J. Reder] + *) mod_mime: Workaround to prevent a segfault if r->filename=NULL [Brian Pane] diff --git a/modules/experimental/mod_cache.c b/modules/experimental/mod_cache.c index fb0609f3ee..bf7ccbebfe 100644 --- a/modules/experimental/mod_cache.c +++ b/modules/experimental/mod_cache.c @@ -532,11 +532,11 @@ static int cache_in_filter(ap_filter_t *f, apr_bucket_brigade *in) * We include 304 Not Modified here too as this is the origin server * telling us to serve the cached copy. */ - reason = apr_pstrcat(p, "Response status %d", r->status); + reason = apr_psprintf(p, "Response status %d", r->status); } else if (exps != NULL && exp == APR_DATE_BAD) { /* if a broken Expires header is present, don't cache it */ - reason = apr_pstrcat(p, "Broken expires header %s", exp); + reason = apr_psprintf(p, "Broken expires header %s", exp); } else if (r->args && exps == NULL) { /* if query string present but no expiration time, don't cache it -- 2.40.0