Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Fix crash in pcre_callout with numerical callout 0
- X-seq: zsh-workers 54402
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Cc: Oliver Kiddle <opk@xxxxxxx>
- Subject: PATCH: Fix crash in pcre_callout with numerical callout 0
- Date: Tue, 28 Apr 2026 05:37:19 +0200
- Archived-at: <https://zsh.org/workers/54402>
- List-id: <zsh-workers.zsh.org>
We don't use numerical callouts at all, but not crashing is at least a more useful behavior. While it is true that callout_number is always 0 for string callouts, it is not true that it is never 0 for numerical callouts, so check that we got a string too.
---
Src/Modules/pcre.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Src/Modules/pcre.c b/Src/Modules/pcre.c
index 67157cc016..98b52f8de9 100644
--- a/Src/Modules/pcre.c
+++ b/Src/Modules/pcre.c
@@ -134,7 +134,7 @@ pcre_callout(pcre2_callout_block_8 *block, UNUSED(void *callout_data))
Eprog prog;
int ret=0;
- if (!block->callout_number &&
+ if (!block->callout_number && block->callout_string &&
((prog = parse_string((char *) block->callout_string, 0))))
{
int ef = errflag, lv = lastval;
--
2.38.1
Messages sorted by:
Reverse Date,
Date,
Thread,
Author