From 5a51688f77c6616e1ea81c5bb0e4eebe70c9422a Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Sat, 5 Oct 2024 11:41:20 +1000 Subject: regexp: fix infinite recursion with -expanded The previous approach could end up with a zero length "EXACTLY" match that would recurse infinitely until stack overflow. Fixes #313 Signed-off-by: Steve Bennett --- jimregexp.h | 1 + 1 file changed, 1 insertion(+) (limited to 'jimregexp.h') diff --git a/jimregexp.h b/jimregexp.h index 2c81e68..86a94f6 100644 --- a/jimregexp.h +++ b/jimregexp.h @@ -49,6 +49,7 @@ typedef struct regexp { int regmust; /* Internal use only. */ int regmlen; /* Internal use only. */ int *program; /* Allocated */ + char *exp; /* NULL or allocated version of regcomp expression (for REG_EXPANDED) */ /* working state - compile */ const char *regparse; /* Input-scan pointer. */ -- cgit v1.1