From 0c36081dd3a173ed87ed71dcc4e76b5cb9d65989 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 31 May 2002 16:59:13 +0000 Subject: [PATCH] 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 --- modules/mappers/mod_userdir.c | 5 ++--- 1 file 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; -- 2.50.1