summaryrefslogtreecommitdiffstats
path: root/generic/regcomp.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-02-27 08:02:36 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-02-27 08:02:36 (GMT)
commitbe449c196746dca12d429e2dfd39fb7af33a121c (patch)
tree1d08a0617c378ebde5d25be185758f4b076c87ca /generic/regcomp.c
parent80cbd84d7eccb757a76574eb96df888238439837 (diff)
downloadtcl-be449c196746dca12d429e2dfd39fb7af33a121c.zip
tcl-be449c196746dca12d429e2dfd39fb7af33a121c.tar.gz
tcl-be449c196746dca12d429e2dfd39fb7af33a121c.tar.bz2
[Bug 3606139]: missing error check allows regexp to crash Tcl. Thanks to Tom Lane for providing the test-case and the patch.
Diffstat (limited to 'generic/regcomp.c')
-rw-r--r--generic/regcomp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/generic/regcomp.c b/generic/regcomp.c
index a1fe5bc..307877a 100644
--- a/generic/regcomp.c
+++ b/generic/regcomp.c
@@ -675,6 +675,7 @@ int partial; /* is this only part of a branch? */
/* NB, recursion in parseqatom() may swallow rest of branch */
parseqatom(v, stopper, type, lp, right, t);
+ NOERRN();
}
if (!seencontent) { /* empty branch */
@@ -1084,6 +1085,7 @@ struct subre *top; /* subtree top */
EMPTYARC(atom->end, rp);
t->right = subre(v, '=', 0, atom->end, rp);
}
+ NOERR();
assert(SEE('|') || SEE(stopper) || SEE(EOS));
t->flags |= COMBINE(t->flags, t->right->flags);
top->flags |= COMBINE(top->flags, t->flags);