Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: regex: regfree on pattern where regcomp failed could be undefined behavior
- X-seq: zsh-workers 54561
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: PATCH: regex: regfree on pattern where regcomp failed could be undefined behavior
- Date: Thu, 14 May 2026 17:20:11 +0200
- Archived-at: <https://zsh.org/workers/54561>
- In-reply-to: <20260514152019.27243-1-mikachu@gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <20260514152019.27243-1-mikachu@gmail.com>
---
Src/Modules/regex.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Src/Modules/regex.c b/Src/Modules/regex.c
index d02769ef03..859312a2a4 100644
--- a/Src/Modules/regex.c
+++ b/Src/Modules/regex.c
@@ -77,7 +77,7 @@ zcond_regex_match(char **a, int id)
r = regcomp(&re, rhre, rcflags);
if (r) {
zregex_regerrwarn(r, &re, "failed to compile regex");
- break;
+ goto CLEAN_BASEMETA;
}
/* re.re_nsub is number of parenthesized groups, we also need
* 1 for the 0 offset, which is the entire matched portion
--
2.38.1
Messages sorted by:
Reverse Date,
Date,
Thread,
Author