readdir: drop bogus code
* libc/posix/readdir.c (readdir): Drop bogus attempt to catch bogus pointers.
This commit is contained in:
parent
f20f7e36ad
commit
0cf8865cf0
@ -1,3 +1,8 @@
|
|||||||
|
2012-07-20 Eric Blake <eblake@redhat.com>
|
||||||
|
|
||||||
|
* libc/posix/readdir.c (readdir): Drop bogus attempt to catch
|
||||||
|
bogus pointers.
|
||||||
|
|
||||||
2012-07-18 Ralf Corsépius <ralf.corsepius@rtems.org>
|
2012-07-18 Ralf Corsépius <ralf.corsepius@rtems.org>
|
||||||
|
|
||||||
* libc/sys/rtems/machine/_types.h (_ssize_t): Use signed int for
|
* libc/sys/rtems/machine/_types.h (_ssize_t): Use signed int for
|
||||||
|
@ -75,12 +75,6 @@ _DEFUN(readdir, (dirp),
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
dp = (struct dirent *)(dirp->dd_buf + dirp->dd_loc);
|
dp = (struct dirent *)(dirp->dd_buf + dirp->dd_loc);
|
||||||
if ((int)dp & 03) { /* bogus pointer check */
|
|
||||||
#ifdef HAVE_DD_LOCK
|
|
||||||
__lock_release_recursive(dirp->dd_lock);
|
|
||||||
#endif
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
if (dp->d_reclen <= 0 ||
|
if (dp->d_reclen <= 0 ||
|
||||||
dp->d_reclen > dirp->dd_len + 1 - dirp->dd_loc) {
|
dp->d_reclen > dirp->dd_len + 1 - dirp->dd_loc) {
|
||||||
#ifdef HAVE_DD_LOCK
|
#ifdef HAVE_DD_LOCK
|
||||||
|
Loading…
x
Reference in New Issue
Block a user