public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/9819] New: readdir segmentation faults when passed NULL
@ 2009-02-04 17:53 rbanfield at weogeo dot com
2009-02-04 18:05 ` [Bug libc/9819] " drepper at redhat dot com
0 siblings, 1 reply; 2+ messages in thread
From: rbanfield at weogeo dot com @ 2009-02-04 17:53 UTC (permalink / raw)
To: glibc-bugs
readdir from dirent.h produces a segmentation fault if passed a NULL value,
which can easily happen if the result of opendir is not checked against NULL.
#include<dirent.h>
int main()
{
readdir(NULL);
}
According to the man pages: "The readdir() function returns a pointer to a
dirent structure, or NULL if an error occurs or end of the directory stream is
reached. On error, errno is set appropriately."
Fedora 10:
glibc-devel-2.9-3.x86_64
glibc-2.9-3.x86_64
glibc-headers-2.9-3.x86_64
glibc-common-2.9-3.x86_64
--
Summary: readdir segmentation faults when passed NULL
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: drepper at redhat dot com
ReportedBy: rbanfield at weogeo dot com
CC: glibc-bugs at sources dot redhat dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=9819
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-02-04 18:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-04 17:53 [Bug libc/9819] New: readdir segmentation faults when passed NULL rbanfield at weogeo dot com
2009-02-04 18:05 ` [Bug libc/9819] " drepper at redhat dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).