This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/1162] New: opendir("...") doesnt fails, readdir segfaults


Passing 3 or more dots to opendir doesnt fails on the systems I tested (sorry, I
dont have time nor cpu power to test on vanilla sources).

After opendir returns a semi-valid identifier, calling readdir causes a
segmentation fault.

Sample code:

----
#include <dirent.h>

main()
{
        struct dirent *e;
        DIR *d = opendir("..."); // 3 or more dots
        
        if (d < 0)
        {
                perror("Good, survived. Error: ");
                exit(1);
        }

        printf("Bad, will fail...\n");
        e = readdir(d);
}
----

Tested systems:

Slackware/x86

    * glibc: 2.3.2
    * gcc: 3.2.3
    * kernel: 2.4.25-grsec

Gentoo/ppc

    * glibc: 2.3.4
    * gcc: 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r3, propolice)
    * kernel: 2.4.23-ben1

-- 
           Summary: opendir("...") doesnt fails, readdir segfaults
           Product: glibc
           Version: 2.3.4
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: gotom at debian dot or dot jp
        ReportedBy: alex at fsn dot hu
                CC: glibc-bugs at sources dot redhat dot com
  GCC host triplet: powerpc-unknown-linux-gnu and i486-slackware-linux


http://sources.redhat.com/bugzilla/show_bug.cgi?id=1162

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]