From f53caf1f863f140de1c1af51906e658c9fb7d7d6 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 20 Feb 2019 11:11:12 -0300 Subject: Avoid stack overflow when handling nested captures The C code uses recursion to handle nested captures, so a too deep nesting could create a stack overflow. The fix limits the handling of nested captures to 'MAXRECLEVEL' (default is 200 levels). --- lpcap.h | 1 + 1 file changed, 1 insertion(+) (limited to 'lpcap.h') diff --git a/lpcap.h b/lpcap.h index bf52b67..dc10d69 100644 --- a/lpcap.h +++ b/lpcap.h @@ -44,6 +44,7 @@ typedef struct CapState { int ptop; /* index of last argument to 'match' */ const char *s; /* original string */ int valuecached; /* value stored in cache slot */ + int reclevel; /* recursion level */ } CapState; -- cgit v1.2.3-55-g6feb