This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/17804] New: scandirat fails with ENOMEM because it checks for errno even if malloc succeeded
- From: "mihai.serban at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Tue, 06 Jan 2015 13:34:57 +0000
- Subject: [Bug libc/17804] New: scandirat fails with ENOMEM because it checks for errno even if malloc succeeded
- Auto-submitted: auto-generated
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.