]> granicus.if.org Git - apache/commitdiff
Fix bug in r785425 (dereference null pointer when not configured)
authorNick Kew <niq@apache.org>
Wed, 17 Jun 2009 00:31:10 +0000 (00:31 +0000)
committerNick Kew <niq@apache.org>
Wed, 17 Jun 2009 00:31:10 +0000 (00:31 +0000)
and add a couple of comments.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@785457 13f79535-47bb-0310-9956-ffa450edef68

modules/mappers/mod_dir.c

index 002d9717c39d3f1b322a0367fb9347f3be514a69..95071c956b16b69130f3ea05982f91ee41628a94 100644 (file)
@@ -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);
 }