aboutsummaryrefslogtreecommitdiff
path: root/jimregexp.h
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2024-10-05 11:41:20 +1000
committerSteve Bennett <steveb@workware.net.au>2025-03-13 10:26:16 +1000
commit5a51688f77c6616e1ea81c5bb0e4eebe70c9422a (patch)
tree87df81272088a981e665647de02e08db2b1a9710 /jimregexp.h
parentbde04fa7afb26f29501253aff57140158bc7f518 (diff)
downloadjimtcl-5a51688f77c6616e1ea81c5bb0e4eebe70c9422a.zip
jimtcl-5a51688f77c6616e1ea81c5bb0e4eebe70c9422a.tar.gz
jimtcl-5a51688f77c6616e1ea81c5bb0e4eebe70c9422a.tar.bz2
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 <steveb@workware.net.au>
Diffstat (limited to 'jimregexp.h')
-rw-r--r--jimregexp.h1
1 files changed, 1 insertions, 0 deletions
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. */