From: Kevin McCarthy Date: Fri, 14 Jul 2017 22:19:57 +0000 (-0700) Subject: Decrease regex failure stack limit. (closes #3955) X-Git-Tag: mutt-1-9-rel~33 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=367b012a6342b9e47faa3579f3403230356a3ab3;p=mutt Decrease regex failure stack limit. (closes #3955) When using alloca(), the built-in regexp library limited the failure stack to 20,000 entries. This value is too large, and causes alloca() to segfault in the example provided in the ticket. Decrease the limit to 8000. Thanks to Thorsten Wißmann for the excellent bug report, which made debugging this much easier. --- diff --git a/regex.c b/regex.c index 40979af7..fbec647e 100644 --- a/regex.c +++ b/regex.c @@ -1116,7 +1116,7 @@ typedef struct #if defined (MATCH_MAY_ALLOCATE) /* 4400 was enough to cause a crash on Alpha OSF/1, whose default stack limit is 2mb. */ -int re_max_failures = 20000; +int re_max_failures = 8000; #else int re_max_failures = 2000; #endif