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

Marc Norton marc.norton at ...402...
Tue Aug 3 09:16:02 EDT 2004


ISO C says it should work, I believe it's a dead issue than.  I do not
know who or what standard indicates the calloc parameters imply
alignment requirements. It is clear it's not what the ISO standard
states.  So at this point it seems your suggesting a change to something
that is not broke nor is there any standard that says is could be. I
don't see this as fruitful, we have bigger fish to fry.  

> -----Original Message-----
> From: snort-devel-admin at lists.sourceforge.net [mailto:snort-devel-
> admin at lists.sourceforge.net] On Behalf Of Erik de Castro Lopo
> Sent: Thursday, July 29, 2004 7:08 PM
> To: snort-devel at lists.sourceforge.net
> Subject: Re: [Snort-devel] Bug : misuse of calloc (patch included)
> 
> 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.
> 
> The problem here is that just because nobody has been bitten
> by this yet, you are assuming that noone will be bitten by
> it in the future. This is probably a bad assumption.
> 
> So, I went away looking for the ISO C spec on what calloc
> does and found this:
> 
>
http://www.opengroup.org/onlinepubs/009695399/functions/calloc.html
> 
> from which I quote:
> 
>     The pointer returned if the allocation succeeds shall be
>     suitably aligned so that it may be assigned to a pointer to
>     any type of object and then used to access such an object
>     or an array of such objects in the space allocated ...
> 
> which supports your postion.
> 
> I have no problem relying on behaviour defined by the ISO C
> specifications. I do have a problem relying on "it seems to
> work for me".
> 
> However, there is still a good reason to fix it; when its
> fixed, noone will bring this issue up again because the
> correct usage of calloc would then make unambiguous sense.
> 
> Erik
> --
> ------------------------------------------------------
> [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.
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by OSTG. Have you noticed the changes
on
> Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
> one more big change to announce. We are now OSTG- Open Source
Technology
> Group. Come see the changes on the new OSTG site. www.ostg.com
> _______________________________________________
> Snort-devel mailing list
> Snort-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/snort-devel






More information about the Snort-devel mailing list