.
D 2026-10-11T06:54:45.257
J cmimetype text/x-fossil-wiki
J comment <tt>regsub\s-command</tt>\swith\smore\sthan\s9\scapturing\sgroups\scan\spanic:\n<verbatim>\nset\sre\s{(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)}\nregsub\s-command\s$re\sabcdefghijkl\s{apply\s{args\s{list\s[llength\s$args]\s$args}}}\n</verbatim>\nIn\s9.0.5\sthis\spanics\swith\s"unable\sto\salloc\s643662021519030588\sbytes".\sIn\s9.1.1\sit\shappens\snot\sto\scrash,\sbut\sthe\slast\sthree\sarguments\sare\sempty\sinstead\sof\s<tt>j\sk\sl</tt>.\sValgrind\sreports\suninitialised\sreads\sin\s<tt>Tcl_RegsubObjCmd()</tt>\sin\sboth.\n\n<tt>Tcl_RegsubObjCmd()</tt>\salways\sasks\sthe\sregexp\sengine\sfor\s10\ssubmatches,\sbut\swith\s<tt>-command</tt>\sit\spasses\sall\s<tt>info.nsubs</tt>\s+\s1\sof\sthem\sto\sthe\scommand,\sreading\sentries\sof\sthe\smatch\sarray\sthat\swere\snever\sset,\sand\suses\sthem\sas\sstring\spositions\sand\slengths.\sAsking\sfor\sall\ssubmatches\swhen\s<tt>-command</tt>\sis\sused\sfixes\sit;\sregsub.n\salso\ssays\sthat\seach\ssubstring\smatching\sa\scapturing\ssub-RE\sis\sappended.
J foundin 9.0.5,\s9.1.0
J login serhiy.storchaka
J priority 5\sMedium
J resolution None
J severity Severe
J status Open
J submitter serhiy.storchaka
J subsystem 43.\sRegexp
J title regsub\s-command\spanics\swith\smore\sthan\s9\scapturing\sgroups
J type Bug
K 41bc9a82988d930fc00145bcd02bb3ce4e169a2c
U serhiy.storchaka
Z ae3c7faf2d817c40f913a9325d6b587e