summaryrefslogtreecommitdiffstats
path: root/newlib/libc/posix/readdir_r.c
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2013-11-19 11:48:02 +0000
committerCorinna Vinschen <corinna@vinschen.de>2013-11-19 11:48:02 +0000
commitff125797e38c9628ae1308973231660a22563309 (patch)
tree2056862e6bca5df3c210eeb7224e730b0e00e9a4 /newlib/libc/posix/readdir_r.c
parent700a3783ee4912e1000347bcde2116863507fbbd (diff)
downloadcygnal-ff125797e38c9628ae1308973231660a22563309.tar.gz
cygnal-ff125797e38c9628ae1308973231660a22563309.tar.bz2
cygnal-ff125797e38c9628ae1308973231660a22563309.zip
* libc/posix/closedir.c: Fix use after free.
Remove useless test dd_fd != -1 * libc/posix/readdir.c: Remove useless test dd_fd == -1 * libc/posix/readdir_r.c: Ditto.
Diffstat (limited to 'newlib/libc/posix/readdir_r.c')
-rw-r--r--newlib/libc/posix/readdir_r.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/newlib/libc/posix/readdir_r.c b/newlib/libc/posix/readdir_r.c
index eafbeca6a..1d526e309 100644
--- a/newlib/libc/posix/readdir_r.c
+++ b/newlib/libc/posix/readdir_r.c
@@ -60,11 +60,6 @@ struct dirent *tmpdp;
#ifdef HAVE_DD_LOCK
__lock_acquire_recursive(dirp->dd_lock);
#endif
-
- if (dirp->dd_fd == -1) {
- *dpp = NULL;
- return errno = EBADF;
- }
for (;;) {
if (dirp->dd_loc == 0) {