summaryrefslogtreecommitdiff
path: root/pcre_exec.c
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2014-11-05 15:08:03 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2014-11-05 15:08:03 +0000
commite2eeaf85f1b5d6c4669b621d309ff904cbf96f4b (patch)
tree14d4b9e8f1ea6a4bc004bc3e1195cd63d42dc6ef /pcre_exec.c
parent21e64c13421369da3dd66c031ff997ab8960860e (diff)
downloadpcre-e2eeaf85f1b5d6c4669b621d309ff904cbf96f4b.tar.gz
Fix bug when there are unset groups prior to (*ACCEPT) within a capturing
group. git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1510 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'pcre_exec.c')
-rw-r--r--pcre_exec.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/pcre_exec.c b/pcre_exec.c
index 654eb9e..fdf7067 100644
--- a/pcre_exec.c
+++ b/pcre_exec.c
@@ -1474,7 +1474,18 @@ for (;;)
md->offset_vector[offset] =
md->offset_vector[md->offset_end - number];
md->offset_vector[offset+1] = (int)(eptr - md->start_subject);
- if (offset_top <= offset) offset_top = offset + 2;
+
+ /* If this group is at or above the current highwater mark, ensure that
+ any groups between the current high water mark and this group are marked
+ unset and then update the high water mark. */
+
+ if (offset >= offset_top)
+ {
+ register int *iptr = md->offset_vector + offset_top;
+ register int *iend = md->offset_vector + offset;
+ while (iptr < iend) *iptr++ = -1;
+ offset_top = offset + 2;
+ }
}
ecode += 1 + IMM2_SIZE;
break;