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/17804] New: scandirat fails with ENOMEM because it checks for errno even if malloc succeeded


https://sourceware.org/bugzilla/show_bug.cgi?id=17804

            Bug ID: 17804
           Summary: scandirat fails with ENOMEM because it checks for
                    errno even if malloc succeeded
           Product: glibc
           Version: 2.20
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: mihai.serban at gmail dot com
                CC: drepper.fsp at gmail dot com

Created attachment 8047
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8047&action=edit
Test program for scandir

In current implementation (2.20) malloc may set errno to ENOMEM even if it
returns a valid pointer. Scandirat uses malloc/realloc internally and it must
handle this case by setting errno to zero as it already does for select and
readdir functions.
Please check the attached test program, its output under strace and the
proposed patch.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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