Received: by taz.hyperreal.com (8.8.4/V2.0) id TAA11977; Sun, 9 Feb 1997 19:45:25 -0800 (PST) Received: from scanner.worldgate.com by taz.hyperreal.com (8.8.4/V2.0) with ESMTP id TAA11966; Sun, 9 Feb 1997 19:45:20 -0800 (PST) Received: from znep.com (uucp@localhost) by scanner.worldgate.com (8.8.5/8.7.3) with UUCP id UAA04580 for new-httpd@hyperreal.com; Sun, 9 Feb 1997 20:45:17 -0700 (MST) Received: from localhost (marcs@localhost) by alive.ampr.ab.ca (8.7.5/8.7.3) with SMTP id UAA14525 for ; Sun, 9 Feb 1997 20:45:46 -0700 (MST) Date: Sun, 9 Feb 1997 20:45:46 -0700 (MST) From: Marc Slemko X-Sender: marcs@alive.ampr.ab.ca To: new-httpd@hyperreal.com Subject: Re: [PATCH] suexec changes In-Reply-To: <199702081646.KAA02000@sierra.zyzzyva.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@hyperreal.com On Sat, 8 Feb 1997, Randy Terbush wrote: > --- 81,95 ---- > #include > #include > > ! #if defined(PATH_MAX) > ! #define AP_MAXPATH PATH_MAX > ! #elif defined(MAXPATHLEN) > ! #define AP_MAXPATH MAXPATHLEN > ! #else > ! #define AP_MAXPATH 256 You should default to making this longer. If neither PATH_MAX nor MAXPATHLEN are defined, this needs to be long enough for all paths possible. 8k would not be too long. > ! #endif > ! > ! #define AP_ENVBUF 256 > > extern char **environ; > static FILE *log; > *************** > *** 173,184 **** > int idx; > > > ! if ((cleanenv = (char **)malloc(CLEAN_ENV_BUF * (sizeof(char *)))) == NULL) { > log_err("failed to malloc env mem\n"); > exit(120); > } > > ! for (ep = environ; *ep; ep++) { > if (!strncmp(*ep, "HTTP_", 5)) { > cleanenv[cidx] = *ep; > cidx++; > --- 181,192 ---- > int idx; > > > ! if ((cleanenv = (char **)calloc(AP_ENVBUF, AP_ENVBUF * (sizeof(char *)))) == NULL) { > log_err("failed to malloc env mem\n"); > exit(120); > } You are allocating AP_ENVBUF * AP_ENVBUF memory. That is not what you want is it?