httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <ma...@znep.com>
Subject Re: [PATCH] suexec changes
Date Mon, 10 Feb 1997 03:45:46 GMT
On Sat, 8 Feb 1997, Randy Terbush wrote:

> --- 81,95 ----
>   #include <time.h>
>   #include <sys/stat.h>
>   
> ! #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?


Mime
View raw message