Task #739
non-portable readdir_r() use can cause segmentation fault
Description
The gromacs 4.5.4 pdb2gmx causes a segmentation fault on Solaris due
to a non-portable use of readdir_r() in futil.c. On Solaris, memory must
be allocated for the dirent structure, since the d_name member is defined
as "char d_name1" (on Linux it is "char d_name256").
The attached patch fixes the issue using by allocating memory for the
dirent structure as suggested in the Linux readdir(3) man page:
http://www.kernel.org/doc/man-pages/online/pages/man3/readdir.3.html
Associated revisions
History
#1 Updated by Rossen Apostolov over 9 years ago
- Target version set to 4.5.5
#2 Updated by Berk Hess over 9 years ago
- Status changed from New to Closed
I fixed this issue, although in a slightly different way.
fixed dirrent_t memory allocation issue on Solaris, fixes #739