This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/9819] readdir segmentation faults when passed NULL
- From: "bugdal at aerifal dot cx" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Wed, 28 Sep 2011 03:11:51 +0000
- Subject: [Bug libc/9819] readdir segmentation faults when passed NULL
- Auto-submitted: auto-generated
- References: <bug-9819-131@http.sourceware.org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=9819
Rich Felker <bugdal at aerifal dot cx> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bugdal at aerifal dot cx
--- Comment #3 from Rich Felker <bugdal at aerifal dot cx> 2011-09-28 03:11:51 UTC ---
No, it would hide bugs in your code and encourage the writing of non-portable
programs. You cannot haphazardly pass NULL to functions that expect valid
pointers and ignore the contract of the function's interface. Crashing
immediately is the best possible behavior because it forces you to fix the bug.
BTW, by the same argument, would you want all the stdio functions to check for
NULL FILE* arguments? Even getc/putc?
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.