diff options
author | Stefan Fritsch <sf@apache.org> | 2010-09-25 19:46:52 +0200 |
---|---|---|
committer | Stefan Fritsch <sf@apache.org> | 2010-09-25 19:46:52 +0200 |
commit | 86c2f0c1d3cda8ba83a7e5285e8c39cb1efa02e6 (patch) | |
tree | ae86b76cf291b9816dc22f11082614fbceaac8ee /modules/aaa | |
parent | A note about per-module logging. (diff) | |
download | apache2-86c2f0c1d3cda8ba83a7e5285e8c39cb1efa02e6.tar.xz apache2-86c2f0c1d3cda8ba83a7e5285e8c39cb1efa02e6.zip |
don't use data allocated from ptemp when parsing .htaccess
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1001284 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/aaa')
-rw-r--r-- | modules/aaa/mod_authz_host.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/modules/aaa/mod_authz_host.c b/modules/aaa/mod_authz_host.c index b42f0326da..20c71697d4 100644 --- a/modules/aaa/mod_authz_host.c +++ b/modules/aaa/mod_authz_host.c @@ -113,8 +113,9 @@ static const char *ip_parse_config(cmd_parms *cmd, char *mask; apr_status_t rv; - *ip = apr_hash_get(parsed_subnets, w, APR_HASH_KEY_STRING); - if (*ip) { + if (parsed_subnets && + (*ip = apr_hash_get(parsed_subnets, w, APR_HASH_KEY_STRING)) != NULL) + { /* we already have parsed this subnet */ ip++; continue; @@ -136,7 +137,8 @@ static const char *ip_parse_config(cmd_parms *cmd, w, msgbuf); } - apr_hash_set(parsed_subnets, w, APR_HASH_KEY_STRING, *ip); + if (parsed_subnets) + apr_hash_set(parsed_subnets, w, APR_HASH_KEY_STRING, *ip); ip++; } @@ -256,9 +258,19 @@ static int authz_host_pre_config(apr_pool_t *p, apr_pool_t *plog, return OK; } +static int authz_host_post_config(apr_pool_t *p, apr_pool_t *plog, + apr_pool_t *ptemp, server_rec *s) +{ + /* make sure we don't use this during .htaccess parsing */ + parsed_subnets = NULL; + + return OK; +} + static void register_hooks(apr_pool_t *p) { ap_hook_pre_config(authz_host_pre_config, NULL, NULL, APR_HOOK_MIDDLE); + ap_hook_post_config(authz_host_post_config, NULL, NULL, APR_HOOK_MIDDLE); ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "ip", AUTHZ_PROVIDER_VERSION, |