summaryrefslogtreecommitdiffstats
path: root/modules/mappers/mod_userdir.c
diff options
context:
space:
mode:
authorJustin Erenkrantz <jerenkrantz@apache.org>2002-05-31 18:59:13 +0200
committerJustin Erenkrantz <jerenkrantz@apache.org>2002-05-31 18:59:13 +0200
commit0c36081dd3a173ed87ed71dcc4e76b5cb9d65989 (patch)
treeedcc2d2e9ea7fe5f3143b2774dd7d9cdb73fd65f /modules/mappers/mod_userdir.c
parent Locks are good, provide locks. ab -s -c >1 is [was?] dying on Win32 (diff)
downloadapache2-0c36081dd3a173ed87ed71dcc4e76b5cb9d65989.tar.xz
apache2-0c36081dd3a173ed87ed71dcc4e76b5cb9d65989.zip
Fix segfault when x hasn't been initialized and tighten its scope.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95443 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/mappers/mod_userdir.c')
-rw-r--r--modules/mappers/mod_userdir.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/mappers/mod_userdir.c b/modules/mappers/mod_userdir.c
index 9a29b35145..85c32af08f 100644
--- a/modules/mappers/mod_userdir.c
+++ b/modules/mappers/mod_userdir.c
@@ -227,7 +227,6 @@ static int translate_userdir(request_rec *r)
const char *userdirs;
const char *w, *dname;
char *redirect;
- char *x = NULL;
apr_finfo_t statbuf;
/*
@@ -285,7 +284,7 @@ static int translate_userdir(request_rec *r)
while (*userdirs) {
const char *userdir = ap_getword_conf(r->pool, &userdirs);
- char *filename = NULL;
+ char *filename = NULL, *x = NULL;
apr_status_t rv;
int is_absolute = ap_os_is_path_absolute(r->pool, userdir);
@@ -317,7 +316,7 @@ static int translate_userdir(request_rec *r)
else
filename = apr_pstrcat(r->pool, userdir, "/", w, NULL);
}
- else if (ap_strchr_c(x, ':')) {
+ else if (x && ap_strchr_c(x, ':')) {
redirect = apr_pstrcat(r->pool, x, w, dname, NULL);
apr_table_setn(r->headers_out, "Location", redirect);
return HTTP_MOVED_TEMPORARILY;