Created attachment 4638 test.c
This reports the reclen coming from the dirp->data. sysdeps/unix/readdir_r.c:
bytes = __GETDENTS (dirp->fd, dirp->data, maxread); ... dp = (DIRENT_TYPE *) &dirp->data[dirp->offset]; ... reclen = dp->d_reclen; ... *result = memcpy (entry, dp, reclen);
It seems that the memcpy is what overflows. I wonder if adding an "assert(sizeof(*entry) >= reclen)" should be added in here for fun, too.
Created attachment 4638
test.c
This reports the reclen coming from the dirp->data. sysdeps/ unix/readdir_ r.c:
bytes = __GETDENTS (dirp->fd, dirp->data, maxread); data[dirp- >offset] ;
...
dp = (DIRENT_TYPE *) &dirp->
...
reclen = dp->d_reclen;
...
*result = memcpy (entry, dp, reclen);
It seems that the memcpy is what overflows. I wonder if adding an sizeof( *entry) >= reclen)" should be added in here for fun, too.
"assert(