httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <trawi...@bellsouth.net>
Subject [?PATCH?] problem in EXEC_ON_READ logic
Date Tue, 16 May 2000 14:54:42 GMT
The symptom is in http_config.c, function ap_build_config_sub().  I'm
dying on "(*current)->next = sub_tree;" because *current is NULL.

    if ((cmd = ap_find_command_in_modules(cmd_name, &mod)) != NULL) {
        if (cmd->req_override & EXEC_ON_READ) {
            const char *retval;
            ap_directive_t *sub_tree = NULL;

            retval = execute_now(cmd_name, args, parms, p, temp_pool, 
                                 &sub_tree, *curr_parent);
            (*current)->next = sub_tree;
            while ((*current)->next != NULL) {
                (*current) = (*current)->next;
            }
            return retval;
        }
    }

(dbx) c
[2] stopped in unnamed block $b117 at line 872 in file "http_config.c"
($t1)
  872               (*current)->next = sub_tree;
(dbx) print *current
(nil)
(dbx) where
unnamed block $b117, line 872 in "http_config.c"
ap_build_config_sub(p = 0xa3fac10, temp_pool = 0xa424068, l = "<IfModule mod_access.c>",
parms = 0x46460, current = 0x465a0, curr_parent = 0x465a4), line 872 in "http_config.c"
ap_build_config(parms = 0x46460, p = 0xa3fac10, temp_pool = 0xa424068,conftree = 0x464c0),
line 1024 in "http_config.c"
ap_process_resource_config(s = 0xa3fb5a0, fname = "/tmp/two/conf/httpd.conf", p = 0xa3fac10,
ptemp = 0xa424068), line 1275 in "http_config.c"
ap_read_config(process = 0xa3f8c28, ptemp = 0xa424068, confname = "conf/httpd.conf"), line
1520 in "http_config.c"
main(argc = 1, argv = 0xa3f4758), line 376 in "http_main.c"
.() at 0x3b61e
.() at 0xab190e 

Here is a small configuration file which I can use to duplicate the
problem (on OS/390, at least):

<Files ~ "^\.ht">
<IfModule mod_access.c>
    Order allow,deny
    Deny from all
</IfModule>
</Files>

Here is a patch which gets rid of any obvious symptoms, at least for
my normal configuration file and the tiny configuration file:

Index: src/main/http_config.c
===================================================================
RCS file: /cvs/apache/apache-2.0/src/main/http_config.c,v
retrieving revision 1.46
diff -u -r1.46 http_config.c
--- http_config.c	2000/05/15 19:21:38	1.46
+++ http_config.c	2000/05/16 14:53:32
@@ -869,9 +869,11 @@
 
             retval = execute_now(cmd_name, args, parms, p, temp_pool, 
                                  &sub_tree, *curr_parent);
-            (*current)->next = sub_tree;
-            while ((*current)->next != NULL) {
-                (*current) = (*current)->next;
+            if (*current) {
+                (*current)->next = sub_tree;
+                while ((*current)->next != NULL) {
+                    (*current) = (*current)->next;
+                }
             }
             return retval;
         }

I don't have time at the present to see if this is the right change to
make... for now it brings me happiness, and that is enough.

-- 
Jeff Trawick | trawick@ibm.net | PGP public key at web site:
     http://www.geocities.com/SiliconValley/Park/9289/
          Born in Roswell... married an alien...

Mime
View raw message