]> granicus.if.org Git - apache/commitdiff
* support/suexec.c (clean_env): Avoid use of sprintf; no functional change.
authorJoe Orton <jorton@apache.org>
Fri, 9 Nov 2018 16:02:21 +0000 (16:02 +0000)
committerJoe Orton <jorton@apache.org>
Fri, 9 Nov 2018 16:02:21 +0000 (16:02 +0000)
PR: 33207

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1846253 13f79535-47bb-0310-9956-ffa450edef68

support/suexec.c

index 22ef8462e2563952660d41bb58f0d664d65a7519..55c001a5c0159c2a0dc305a687a8ea611954a59d 100644 (file)
@@ -223,7 +223,6 @@ static void log_no_err(const char *fmt,...)
 
 static void clean_env(void)
 {
-    char pathbuf[512];
     char **cleanenv;
     char **ep;
     int cidx = 0;
@@ -245,8 +244,7 @@ static void clean_env(void)
         exit(123);
     }
 
-    sprintf(pathbuf, "PATH=%s", AP_SAFE_PATH);
-    cleanenv[cidx] = strdup(pathbuf);
+    cleanenv[cidx] = strdup("PATH=" AP_SAFE_PATH);
     if (cleanenv[cidx] == NULL) {
         log_err("failed to malloc memory for environment\n");
         exit(124);