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; 9+ 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] 9+ messages in thread

end of thread, other threads:[~2014-07-01 20:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-9819-131@http.sourceware.org/bugzilla/>
2011-09-27 21:46 ` [Bug libc/9819] readdir segmentation faults when passed NULL jg at jguk dot org
2011-09-28  3:12 ` bugdal at aerifal dot cx
2011-10-03 23:52 ` jg at jguk dot org
2011-10-04  0:36 ` bugdal at aerifal dot cx
2011-10-28 23:59 ` jg at jguk dot org
2011-10-29  0:19 ` bugdal at aerifal dot cx
2011-11-13  0:51 ` jg at jguk dot org
2014-07-01 20:58 ` fweimer at redhat dot com
2009-02-04 17:53 [Bug libc/9819] New: " 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).