<i>Extra Tcl_DecrRefCount in Tcl_LSearchjObjCmd</i> status still Open with 3 other changes
by
.
D 2026-10-11T11:20:44.059
J icomment This\sis\sreachable:\smatching\sfails\swith\s"out\sof\smemory"\swhen\sthe\sdissector's\nper-character\swork\sarray\scannot\sbe\sallocated,\se.g.\sfor\sa\squantified\sgroup\swith\sa\nbackref\son\sa\slong\sstring.\sThe\sextra\s<code>Tcl_DecrRefCount(patObj)</code>\sthen\nfrees\sthe\spattern\swhile\sit\sis\sstill\sin\suse.\sReproducer:\srun\n<code>(ulimit\s-v\s1100000;\stclsh\slsearch-uaf.tcl)</code>\swith\n<verbatim>\nproc\st\s{}\s{\n\s\s\s\sset\sl\s[list\s[string\srepeat\sa\s100000000]]\n\s\s\s\sset\spat\s[string\scat\s{^(?:(a)\\1)*}\s{$}]\n\s\s\s\sfor\s{set\si\s0}\s{$i\s<\s4}\s{incr\si}\s{\n\tcatch\s{lsearch\s-regexp\s$l\s$pat}\smsg\n\tputs\s"$msg:\s$pat"\n\s\s\s\s}\n}\nt\n</verbatim>\nOn\s9.0.5\sthe\slast\sline\sprints\s<code>invokeStk1</code>\sinstead\sof\sthe\spattern.\nProposed\sfix\sin\sbranch\s[/timeline?r=lsearch-regexp-error-refcount|lsearch-regexp-error-refcount].
J login serhiy.storchaka
J mimetype text/x-fossil-wiki
K 3595762fffffffffffffffffffffffffffffffff
U serhiy.storchaka
Z d5ee951c1c933209380c51ab84e66de6