dgaudet 97/12/14 12:48:56
Modified: src/main alloc.c
src/modules/standard mod_alias.c
Log:
Fix a SIGSEGV for "RedirectMatch gone /". Fix a slight incompatibility
introduced into pstrcat in rev 1.42.
PR: 1319
Reviewed by: Ben Laurie, Martin Kraemer
Revision Changes Path
1.61 +1 -3 apachen/src/main/alloc.c
Index: alloc.c
===================================================================
RCS file: /export/home/cvs/apachen/src/main/alloc.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -r1.60 -r1.61
--- alloc.c 1997/12/07 21:33:18 1.60
+++ alloc.c 1997/12/14 20:48:54 1.61
@@ -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 */
1.27 +10 -4 apachen/src/modules/standard/mod_alias.c
Index: mod_alias.c
===================================================================
RCS file: /export/home/cvs/apachen/src/modules/standard/mod_alias.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- mod_alias.c 1997/10/22 20:30:13 1.26
+++ mod_alias.c 1997/12/14 20:48:55 1.27
@@ -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, "");
}
}
}