This is the mail archive of the newlib@sourceware.org mailing list for the newlib 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]

scandir issue on RTEMS


Hi,

I got this report from a user and wondered if someone
could provide a recommendation.  I am getting wrapped
around the axle trying to figure out what should be
set by whom where.

It is used in scandir() (newlib-1.17.0/newlib/libc/posix/scandir.c:117) by the macro DIRSIZ. Where DIRSIZ uses the MAXNAMELEN define which is set incorrectly. It does not match the sizeof(struct dirent) which makes the DIRSIZ return a negative number, then malloc(DIRSIZ(d)) will try to allocate 4GB which fail.

My guess is that MAXNAMELEN should be defined in newlib-1.17.0/newlib/libc/sys/rtems/sys/dirent.h or newlib-1.17.0/newlib/libc/sys/rtems/include/limits.h or in a new file.


-- Joel Sherrill, Ph.D. Director of Research & Development joel.sherrill@OARcorp.com On-Line Applications Research Ask me about RTEMS: a free RTOS Huntsville AL 35805 Support Available (256) 722-9985



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