freeaddrinfo(NULL)

Brooks Davis brooks at one-eyed-alien.net
Tue Sep 21 11:19:10 PDT 2004


On Tue, Sep 21, 2004 at 08:07:46PM +0200, Thomas Quinot wrote:
> * Hajimu UMEMOTO, 2004-09-21 :
> 
> > Because, the behavior of freeaddrinfo (NULL) is undefined in RFC 2553
> > nor RFC 3493.  Having such an assumption is a potentially bug and
> > lose portability.
> 
> That a construct has no defined meaning does not imply that we must make
> every effort to break applications that (erroneously) make use of it.
> Would there be any significant drawback for conforming applications
> if we made our best to deploy a safety net againt buggy user programs
> by not segfaulting in this case?
> 
> There are many situations where the system already detects an invalid
> pointer and reports it gracefully as an error rather than triggering a
> fatal signal.

If it wouldn't be too evil, making freeaddrinfo die when malloc's A flag
was set and succeed otherwise might be a reasionable compromise.

-- Brooks

-- 
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-net/attachments/20040921/b6f03c08/attachment.bin


More information about the freebsd-net mailing list