httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <...@jaguNET.com>
Subject Re: minor -Wall warning
Date Fri, 25 Apr 1997 01:17:04 GMT
Dean Gaudet wrote:
> 
> On Thu, 24 Apr 1997, Jim Jagielski wrote:
> > With latest CVS snapshot:
> > 
> >     gcc -c   -O2 -DAUX -D_POSIX_SOURCE -DSTATUS -Wall  util_script.c
> >     util_script.c: In function `call_exec':
> >     util_script.c:439: warning: `grpname' might be used uninitialized in
> >      this function
> > 
> > A little change to 'char *grpname = NULL;' will fix that.
> 
> I think it's worse than that.  See enclosed patch.

Ugg. You're right... The 'else' part of the (!strncmp("/~",r->uri,2))
conditional doesn't set grpname. 

> 
> Dean
> 
> Index: util_script.c
> ===================================================================
> RCS file: /export/home/cvs/apache/src/util_script.c,v
> retrieving revision 1.49
> diff -c -3 -r1.49 util_script.c
> *** util_script.c	1997/04/24 23:25:09	1.49
> --- util_script.c	1997/04/25 00:57:51
> ***************
> *** 572,579 ****
>   		log_unixerr("getgrgid", NULL, "invalid groupid", r->server);
>   		return;
>   	    }
> -             execuser = (char *) palloc (r->pool, sizeof(pw->pw_name));
>               execuser = pw->pw_name;
>           }
>     
>     	if (shellcmd)
> --- 572,579 ----
>   		log_unixerr("getgrgid", NULL, "invalid groupid", r->server);
>   		return;
>   	    }
>               execuser = pw->pw_name;
> + 	    grpname = gr->gr_name;
>           }
>     
>     	if (shellcmd)
> 


-- 
====================================================================
      Jim Jagielski            |       jaguNET Access Services
     jim@jaguNET.com           |       http://www.jaguNET.com/
                  "Not the Craw... the CRAW!"

Mime
View raw message