aboutsummaryrefslogtreecommitdiff
path: root/src/libregexp
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2008-01-10 17:06:51 -0500
committerRuss Cox <rsc@swtch.com>2008-01-10 17:06:51 -0500
commit27589754e47a2d2e682ee29daa2d21dff99e509d (patch)
treeac56175d063ab1eda035d349008af6c3e924029c /src/libregexp
parent79ff7e4b5e5c157aa1347152752eb7c2903ecaca (diff)
downloadplan9port-27589754e47a2d2e682ee29daa2d21dff99e509d.tar.gz
plan9port-27589754e47a2d2e682ee29daa2d21dff99e509d.tar.bz2
plan9port-27589754e47a2d2e682ee29daa2d21dff99e509d.zip
libregexp: fix match choice bug
This bug fix allows some pathological regular expressions to cause the regexp library to report a stack overflow (really a stack filling; safe) but it also fixes the behavior of some common regexps. It is too hard to satisfy both.
Diffstat (limited to 'src/libregexp')
-rw-r--r--src/libregexp/regexec.c2
-rw-r--r--src/libregexp/rregexec.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libregexp/regexec.c b/src/libregexp/regexec.c
index c04182a1..a00fbcbc 100644
--- a/src/libregexp/regexec.c
+++ b/src/libregexp/regexec.c
@@ -132,7 +132,7 @@ regexec1(Reprog *progp, /* program to run */
break;
case OR:
/* evaluate right choice later */
- if(_renewthread(tl, inst->u1.right, ms, &tlp->se) == tle)
+ if(_renewthread(tlp, inst->u1.right, ms, &tlp->se) == tle)
return -1;
/* efficiency: advance and re-evaluate */
continue;
diff --git a/src/libregexp/rregexec.c b/src/libregexp/rregexec.c
index ec7907da..16d95e67 100644
--- a/src/libregexp/rregexec.c
+++ b/src/libregexp/rregexec.c
@@ -125,7 +125,7 @@ rregexec1(Reprog *progp, /* program to run */
break;
case OR:
/* evaluate right choice later */
- if(_renewthread(tl, inst->u1.right, ms, &tlp->se) == tle)
+ if(_renewthread(tlp, inst->u1.right, ms, &tlp->se) == tle)
return -1;
/* efficiency: advance and re-evaluate */
continue;