Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Date: Sun, 23 Jan 2022 16:45:17 +0100
From: Ismael Luceno <ismael@...ev.co.uk>
To: musl@...ts.openwall.com
Cc: Rich Felker <dalias@...c.org>,
	Ismael Luceno <ismael@...ev.co.uk>
Subject: [PATCH] nftw: Fix clobbering of errno

Signed-off-by: Ismael Luceno <ismael@...ev.co.uk>
---
 src/misc/nftw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/misc/nftw.c b/src/misc/nftw.c
index 8dcff7fefd2a..5b233b2b8e77 100644
--- a/src/misc/nftw.c
+++ b/src/misc/nftw.c
@@ -93,8 +93,8 @@ static int do_nftw(char *path, int (*fn)(const char *, const struct stat *, int,
 				  || (de->d_name[1]=='.'
 				   && !de->d_name[2]))) continue;
 				if (strlen(de->d_name) >= PATH_MAX-l) {
-					errno = ENAMETOOLONG;
 					closedir(d);
+					errno = ENAMETOOLONG;
 					return -1;
 				}
 				path[j]='/';
-- 
2.33.0

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.