summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorJan Kaluža <jkaluza@apache.org>2014-09-11 11:18:38 +0200
committerJan Kaluža <jkaluza@apache.org>2014-09-11 11:18:38 +0200
commit2fa69ec09458a7a6519eb1e960b1fee45da66143 (patch)
tree39ed7105aa279d6e4a76d2c1c9a7b09943d5f778 /modules
parentRebuild. (diff)
downloadapache2-2fa69ec09458a7a6519eb1e960b1fee45da66143.tar.xz
apache2-2fa69ec09458a7a6519eb1e960b1fee45da66143.zip
SECURITY (CVE-2014-3581): Fix a mod_cache NULL pointer deference
in Content-Type handling. mod_cache: Avoid a crash when Content-Type has an empty value. PR56924. Submitted By: Mark Montague <mark catseye.org> Reviewed By: Jan Kaluza git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1624234 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules')
-rw-r--r--modules/cache/cache_util.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/cache/cache_util.c b/modules/cache/cache_util.c
index 5b57003dd9..6862b5335d 100644
--- a/modules/cache/cache_util.c
+++ b/modules/cache/cache_util.c
@@ -1276,8 +1276,10 @@ apr_table_t *cache_merge_headers_out(request_rec *r)
if (r->content_type
&& !apr_table_get(headers_out, "Content-Type")) {
- apr_table_setn(headers_out, "Content-Type",
- ap_make_content_type(r, r->content_type));
+ const char *ctype = ap_make_content_type(r, r->content_type);
+ if (ctype) {
+ apr_table_setn(headers_out, "Content-Type", ctype);
+ }
}
if (r->content_encoding