[Snort-devel] gcc of latest cvs with -Wall found only one small problem

Phil Wood cpw at ...86...
Sat Apr 21 00:05:16 EDT 2001


Would this be better:

*** snort/spp_http_decode.c     Fri Apr 20 20:08:19 2001
--- snort+/spp_http_decode.c    Fri Apr 20 22:03:19 2001
***************
*** 168,172 ****
      int num;
  
!     if(*portlist == NULL)
      {
          FatalError("ERROR %s (%d)=> No arguments to http_decode preprocessor!\n", file_name, file_line);
--- 168,172 ----
      int num;
  
!     if(portlist == NULL || *portlist == '\0')
      {
          FatalError("ERROR %s (%d)=> No arguments to http_decode preprocessor!\n", file_name, file_line);

On Fri, Apr 20, 2001 at 08:34:17PM -0700, Eugene Tsyrklevich wrote:
> actually the correct patch is
> 
> 	if (portlist == NULL)
> 
> otherwise you will get a segfault.
> 
> 
> eugene
> 
> 
> On Fri, Apr 20, 2001 at 08:44:56PM -0600, Phil Wood wrote:
> > Folks,
> > 
> > Trying to keep up with you folks is impossible!  But, anyway my first build
> > did fine.  I like to throw in the venerable -Wall and get some nits.  The
> > only thing that popped out is comparison between a char and NULL which appears
> > to be thought of as an int.  Casting the NULL removed the nit.
> > 
> > Thanks,
> > 
> > Phil
> > 
> > (I see there is another Phil on the snort list, I think I may change my name)
> > 
> > Thanks,
> > 
> > Cornett Wood
> > 
> > (actually that's my real name)
> > 
> > You can call me ...
> > 
> > bye, (cpw at ...86..., or cornett at ...388...)
> > 
> > -*> Snort! <*-
> > Version 1.8-beta3 (Build 12)
> > By Martin Roesch (roesch at ...16..., www.snort.org)
> > 
> > *** snort/spp_http_decode.c     Fri Apr 20 20:08:19 2001
> > --- snort+/spp_http_decode.c    Fri Apr 20 20:29:09 2001
> > ***************
> > *** 168,172 ****
> >       int num;
> >   
> > !     if(*portlist == NULL)
> >       {
> >           FatalError("ERROR %s (%d)=> No arguments to http_decode preprocessor!\n", file_name, file_line);
> > --- 168,172 ----
> >       int num;
> >   
> > !     if(*portlist == (char)NULL)
> >       {
> >           FatalError("ERROR %s (%d)=> No arguments to http_decode preprocessor!\n", file_name, file_line);

-- 
Phil Wood, cpw at ...86...





More information about the Snort-devel mailing list