Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251004125414.1474755-2-musl@raf.org>
Date: Sat,  4 Oct 2025 22:54:14 +1000
From: raf <musl@....org>
To: musl@...ts.openwall.com
Cc: raf <raf@....org>
Subject: [PATCH] fnmatch: fix infinite loop when pattern is non-character byte

From: raf <raf@....org>

---
 src/regex/fnmatch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/regex/fnmatch.c b/src/regex/fnmatch.c
index 978fff88..59f94d9f 100644
--- a/src/regex/fnmatch.c
+++ b/src/regex/fnmatch.c
@@ -89,7 +89,7 @@ escaped:
 		wchar_t wc;
 		int k = mbtowc(&wc, pat, m);
 		if (k<0) {
-			*step = 0;
+			*step = 1;
 			return UNMATCHABLE;
 		}
 		*step = k + esc;
-- 
2.39.5

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.