From 4fbdccc7aa8aedb27bc14bfcfa610dbb8f8e7369 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Wed, 22 Aug 2001 20:03:47 +0000 Subject: [PATCH] fix segv in mod_mime if no AddTypes are configured PR: Obtained from: Submitted by: John Sterling Reviewed by: dougm git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90506 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ modules/http/mod_mime.c | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 204999a9af..db694cd7a3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,7 @@ Changes with Apache 2.0.25-dev + *) fix segv in mod_mime if no AddTypes are configured + [John Sterling ] + *) Enable ssl client authentication at SSL_accept time [Madhusudan Mathihalli ] diff --git a/modules/http/mod_mime.c b/modules/http/mod_mime.c index 1863a77acd..29ae4be429 100644 --- a/modules/http/mod_mime.c +++ b/modules/http/mod_mime.c @@ -812,7 +812,7 @@ static int find_ct(request_rec *r) /* Parse filename extensions which can be in any order */ while (*fn && (ext = ap_getword(r->pool, &fn, '.'))) { - extension_info *exinfo; + extension_info *exinfo = NULL; int found; if (*ext == '\0') /* ignore empty extensions "bad..html" */ @@ -827,9 +827,11 @@ static int find_ct(request_rec *r) ap_str_tolower(ext); #endif - exinfo = (extension_info*) apr_hash_get(conf->extension_mappings, - ext, APR_HASH_KEY_STRING); - + if (conf->extension_mappings != NULL) { + exinfo = (extension_info*)apr_hash_get(conf->extension_mappings, + ext, APR_HASH_KEY_STRING); + } + if (exinfo == NULL) { if ((type = apr_hash_get(mime_type_extensions, ext, APR_HASH_KEY_STRING)) != NULL) { -- 2.50.1