changeset: 7106:c4e507003aa0
user:      Kevin McCarthy <ke...@8t8.us>
date:      Fri Jul 14 15:19:57 2017 -0700
link:      http://dev.mutt.org/hg/mutt/rev/c4e507003aa0

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.

diffs (12 lines):

diff -r 9430d2357bc2 -r c4e507003aa0 regex.c
--- a/regex.c   Thu Jul 13 22:05:28 2017 -0700
+++ b/regex.c   Fri Jul 14 15:19:57 2017 -0700
@@ -1116,7 +1116,7 @@
 #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

Reply via email to