diff options
author | Nick Kew <niq@apache.org> | 2009-06-17 00:31:10 +0000 |
---|---|---|
committer | Nick Kew <niq@apache.org> | 2009-06-17 00:31:10 +0000 |
commit | 1d0a22fad64fcfd68998880fed8a22a508ce91a3 (patch) | |
tree | c6ccfd57cdfc9110e12c16d4334249e37b846a68 /modules/mappers/mod_dir.c | |
parent | f7ff190d74116097e822dc69b25116e6085b5c9d (diff) | |
download | httpd-1d0a22fad64fcfd68998880fed8a22a508ce91a3.tar.gz |
Fix bug in r785425 (dereference null pointer when not configured)
and add a couple of comments.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@785457 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/mappers/mod_dir.c')
-rw-r--r-- | modules/mappers/mod_dir.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/mappers/mod_dir.c b/modules/mappers/mod_dir.c index 002d9717c3..95071c956b 100644 --- a/modules/mappers/mod_dir.c +++ b/modules/mappers/mod_dir.c @@ -125,6 +125,17 @@ static int fixup_dflt(request_rec *r) return DECLINED; } name_ptr = d->dflt; + if (name_ptr == NULL) { + return DECLINED; + } + /* XXX: if DefaultHandler points to something that doesn't exist, + * this may recurse until it hits the limit for internal redirects + * before returning an Internal Server Error. + */ + + /* The logic of this function is basically cloned and simplified + * from fixup_dir below. See the comments there. + */ if (r->args != NULL) { name_ptr = apr_pstrcat(r->pool, name_ptr, "?", r->args, NULL); } @@ -303,6 +314,7 @@ static int fixup_dir(request_rec *r) static void register_hooks(apr_pool_t *p) { + /* the order of these is of no consequence */ ap_hook_fixups(fixup_dir,NULL,NULL,APR_HOOK_LAST); ap_hook_fixups(fixup_dflt,NULL,NULL,APR_HOOK_LAST); } |