
niq at apache
Jun 16, 2009, 5:31 PM
Views: 178
Permalink
|
|
svn commit: r785457 - /httpd/httpd/trunk/modules/mappers/mod_dir.c
|
|
Author: niq Date: Wed Jun 17 00:31:10 2009 New Revision: 785457 URL: http://svn.apache.org/viewvc?rev=785457&view=rev Log: Fix bug in r785425 (dereference null pointer when not configured) and add a couple of comments. Modified: httpd/httpd/trunk/modules/mappers/mod_dir.c Modified: httpd/httpd/trunk/modules/mappers/mod_dir.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mappers/mod_dir.c?rev=785457&r1=785456&r2=785457&view=diff ============================================================================== --- httpd/httpd/trunk/modules/mappers/mod_dir.c (original) +++ httpd/httpd/trunk/modules/mappers/mod_dir.c Wed Jun 17 00:31:10 2009 @@ -125,6 +125,17 @@ 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 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); }
|