[Snort-devel] Bug : misuse of calloc (patch included)

Erik de Castro Lopo erikd+snort at ...2292...
Tue Aug 3 15:54:06 EDT 2004

On Thu, 29 Jul 2004 13:55:29 -0400
"Marc Norton" <marc.norton at ...402...> wrote:

> Our experience has shown this to be a non-issue, even with Solaris/sun
> based systems, which can be pretty fussy.  I appreciate the diligence
> your applying in going through the code, but this is a non-issue for the
> reasons Gisle has cited.

OK, suppose you leave it as it is. That means that every time a 
dilligent programmer looks at this code and see calloc, they will
think "Oh, that doesn't seem right" and look at the man page. Then
they see that the usage doesn't match up with the prototype and then
either send mail to the mailing list or look up the ISO C standard.

Either way, they will waste a whole bunch of time and this could
be avoided completely, by using the function correctly. As I see 
it, there are three options:

   - fix it
   - add a comment to every instance of incorrect usage quoting
     the ISO C standard
   - continue to allow programmers who might otherwise be doing 
     usefil to waste their time

Only one of the above options makes ANY sense to me.

My offer stands. If someone with CVS write access will apply it,
I will generate a clean minimal patch against CVS head.

[N] Erik de Castro Lopo, Senior Computer Engineer
[E] erik.de.castro.lopo at ...2292...
[W] http://www.sensorynetworks.com
[T] +61 2 83022726 
[F] +61 2 94750316 
[A] L4/140 William St, East Sydney NSW 2011, Australia
A good debugger is no substitute for a good test suite.

More information about the Snort-devel mailing list