The following reply was made to PR config/1319; it has been noted by GNATS.

From: Dean Gaudet <[EMAIL PROTECTED]>
To: Andrey Chernov <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED]
Subject: Re: config/1319: SIGSEGV with RedirectMatch
Date: Sat, 13 Dec 1997 17:58:51 -0800 (PST)

 Try this patch against 1.3b3.  It turns out that "Redirect gone /" was
 broken as well by an earlier 1.3 change (may not have been in 1.3b2). 
 
 Dean
 
 Index: main/alloc.c
 ===================================================================
 RCS file: /export/home/cvs/apachen/src/main/alloc.c,v
 retrieving revision 1.60
 diff -u -r1.60 alloc.c
 --- alloc.c    1997/12/07 21:33:18     1.60
 +++ alloc.c    1997/12/14 01:50:05
 @@ -553,11 +553,9 @@
  
      /* Allocate the required string */
  
 -    if (len == 0) {
 -      return NULL;
 -    }
      res = (char *) palloc(a, len + 1);
      cp = res;
 +    *cp = '\0';
  
      /* Pass two --- copy the argument strings into the result space */
  
 Index: modules/standard/mod_alias.c
 ===================================================================
 RCS file: /export/home/cvs/apachen/src/modules/standard/mod_alias.c,v
 retrieving revision 1.26
 diff -u -r1.26 mod_alias.c
 --- mod_alias.c        1997/10/22 20:30:13     1.26
 +++ mod_alias.c        1997/12/14 01:50:05
 @@ -297,10 +297,16 @@
  
        if (p->regexp) {
            if (!regexec(p->regexp, r->uri, p->regexp->re_nsub + 1, regm, 0)) {
 -              found = pregsub(r->pool, p->real, r->uri,
 -                              p->regexp->re_nsub + 1, regm);
 -              if (found && doesc) {
 -                  found = escape_uri(r->pool, found);
 +              if (p->real) {
 +                  found = pregsub(r->pool, p->real, r->uri,
 +                                  p->regexp->re_nsub + 1, regm);
 +                  if (found && doesc) {
 +                      found = escape_uri(r->pool, found);
 +                  }
 +              }
 +              else {
 +                  /* need something non-null */
 +                  found = pstrdup(r->pool, "");
                }
            }
        }
 

Reply via email to