Skip to content
Tcl Source Code Artifact [a1745c694b]
Login

Artifact [a1745c694b]

Artifact a1745c694ba9a744a12902045b8de9247d7131d2df15e69b450fe3c146c4bffd:

Ticket change [a1745c694b] - Ticket [7d47ba7d9497fda8|7d47ba7d94] <i>Stack overruns in regexp code</i> status still Open with 4 other changes by serhiy.storchaka on 2026-10-10 20:48:01.
D 2026-10-10T20:48:01.287
J foundin 8.6.18,\s9.0.5,\s9.1.0
J icomment The\s<tt>(^$)+</tt>\sexample\sis\slong\sfixed,\sbut\sstack\soverflow\swas\sstill\seasy\sto\strigger\sin\s8.6,\s9.0\sand\s9.1:\sparentheses\snested\s40000\sdeep\scrashed\sin\s<tt>parse()</tt>,\sand\slookahead\sconstraints\snested\sonly\s600\sdeep\scrashed\sin\sthe\s<tt>checkLAConstraint()</tt>\srecursion,\sbecause\seach\slevel\skept\sa\s16\sKB\ssmall\sDFA\son\sthe\sstack.\s<tt>STACK_TOO_DEEP()</tt>\swas\sstill\sdefined\sas\s0.\n\nProposed\sfix\sin\sbranch\s[/timeline?r=regexp-stack-depth|regexp-stack-depth],\sfollowing\syour\sproposal:\s<tt>STACK_TOO_DEEP()</tt>\slimits\sthe\sstack\sused\sby\sone\scompile\sor\sexecution\sto\s<tt>REG_MAX_STACK_DEPTH</tt>\s(1\sMB\sby\sdefault),\smeasured\sfrom\sa\slocal\svariable\sof\s<tt>compile()</tt>\sor\s<tt>exec()</tt>,\sand\sit\sis\schecked\sin\sthe\ssame\splaces\sas\sin\sPostgreSQL.\sLookahead\sDFAs\sare\scached\sper\sexecution,\sas\sin\sPostgreSQL's\s<tt>getladfa()</tt>,\sinstead\sof\sbeing\sbuilt\son\sthe\sstack.\sToo\sdeep\snesting\snow\sfails\swith\s"regular\sexpression\sis\stoo\scomplex".\sTests\sreg-33.32\sto\s33.35.
J login serhiy.storchaka
J mimetype text/x-fossil-wiki
K 7d47ba7d9497fda88c064b6152d3a2126c3cd9d2
U serhiy.storchaka
Z eb545efb12d9b6af18b087a3aa19feef