From c1e5c2048f72e90e16709121e0625055685c6db1 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 12 Feb 2003 17:17:09 +0000 Subject: [PATCH] Avoid passing too many characters to getenv. Make sure that only the environment variable string is passed. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98625 13f79535-47bb-0310-9956-ffa450edef68 --- server/util.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/util.c b/server/util.c index 330a541153..246274edf5 100644 --- a/server/util.c +++ b/server/util.c @@ -837,8 +837,10 @@ AP_DECLARE(const char *) ap_resolve_env(apr_pool_t *p, const char * word) strncat(tmp,word,s - word); if ((s[1] == '{') && (e=ap_strchr_c(s,'}'))) { const char *e2 = e; + char *var; word = e + 1; - e = getenv(s+2); + var = apr_pstrndup(p, s+2, e2-(s+2)); + e = getenv(var); if (e) { strcat(tmp,e); } else { -- 2.40.0