From 27589754e47a2d2e682ee29daa2d21dff99e509d Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 10 Jan 2008 17:06:51 -0500 Subject: 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. --- src/libregexp/regexec.c | 2 +- src/libregexp/rregexec.c | 2 +- 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; -- cgit v1.2.3