From: Ruediger Pluem Date: Thu, 20 Mar 2008 21:26:22 +0000 (+0000) Subject: * Initialize hash needed by ap_register_rewrite_mapfunc early enough. X-Git-Tag: 2.3.0~861 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c998f6f688faa2b33b53b675f675e5dd39677e2d;p=thirdparty%2Fapache%2Fhttpd.git * Initialize hash needed by ap_register_rewrite_mapfunc early enough. PR: 44641 Submitted by: Daniel Lescohier Reviewed by: rpluem, niq, wrowe, jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@639465 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index a30eb5c1f48..2a4a23bbd0b 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,9 @@ Changes with Apache 2.3.0 [ When backported to 2.2.x, remove entry from this file ] + *) mod_rewrite: Initialize hash needed by ap_register_rewrite_mapfunc early + enough. PR 44641 [Daniel Lescohier ] + *) mod_authn_dbd: Disambiguate and tidy database authentication error messages. PR 43210. [Chris Darroch, Phil Endecott ] diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index a2720ee4d77..c490b5accda 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -4178,7 +4178,6 @@ static int pre_config(apr_pool_t *pconf, APR_OPTIONAL_FN_TYPE(ap_register_rewrite_mapfunc) *map_pfn_register; /* register int: rewritemap handlers */ - mapfunc_hash = apr_hash_make(pconf); map_pfn_register = APR_RETRIEVE_OPTIONAL_FN(ap_register_rewrite_mapfunc); if (map_pfn_register) { map_pfn_register("tolower", rewrite_mapfunc_tolower); @@ -4979,6 +4978,10 @@ static void register_hooks(apr_pool_t *p) */ static const char * const aszPre[]={ "mod_proxy.c", NULL }; + /* make the hashtable before registering the function, so that + * other modules are prevented from accessing uninitialized memory. + */ + mapfunc_hash = apr_hash_make(p); APR_REGISTER_OPTIONAL_FN(ap_register_rewrite_mapfunc); ap_hook_handler(handler_redirect, NULL, NULL, APR_HOOK_MIDDLE);