From 1e90a12ab202f09b45eb5bfeed748ae3e8b34624 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 6 Sep 2001 17:58:28 +0000 Subject: [PATCH 1/1] Fix a seg fault in mod_include. When we are generating an internal redirect, we must set r->uri to "", not a bogus string, and not NULL. [Ryan Bloom] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90929 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ server/request.c | 2 +- server/util.c | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index e5874bdcd6..685a96dc56 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with Apache 2.0.26-dev + *) Fix a seg fault in mod_include. When we are generating an + internal redirect, we must set r->uri to "", not a bogus + string, and not NULL. [Ryan Bloom] + *) Optimized location_walk, so subrequests, redirects and second passes now reuse previous section merges on a by basis, until we mismatch with the original location_walk. diff --git a/server/request.c b/server/request.c index bbe115a68e..b2ab2d538f 100644 --- a/server/request.c +++ b/server/request.c @@ -1710,7 +1710,7 @@ AP_DECLARE(request_rec *) ap_sub_req_lookup_file(const char *new_file, * but it's actually sometimes to impossible to do it... because the * file may not have a uri associated with it -djg */ - rnew->uri = "INTERNALLY GENERATED file-relative req"; + rnew->uri = apr_pstrdup(rnew->pool, ""); #if 0 /* XXX When this is reenabled, the cache triggers need to be set to faux * dir_walk/file_walk values. diff --git a/server/util.c b/server/util.c index 6e38fafbed..bcfdb5c85d 100644 --- a/server/util.c +++ b/server/util.c @@ -615,7 +615,7 @@ AP_DECLARE(char *) ap_make_dirstr_parent(apr_pool_t *p, const char *s) int l; if (last_slash == NULL) { - return NULL; + return apr_pstrdup(p, ""); } l = (last_slash - s) + 1; d = apr_palloc(p, l + 1); -- 2.40.0