summaryrefslogtreecommitdiff
path: root/pcre/pcre_exec.c
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-12-13 10:14:29 +0100
committerSergei Golubchik <serg@mariadb.org>2015-12-13 10:14:29 +0100
commite7591a1ba94f404a87e65554298574bfa97020f2 (patch)
tree67e7e8327703110ea82989f302fd87dfedbdde1c /pcre/pcre_exec.c
parentc4cc91cdc9a236c22749c9c9decd7d190d0eb7fa (diff)
downloadmariadb-git-e7591a1ba94f404a87e65554298574bfa97020f2.tar.gz
8.38
Diffstat (limited to 'pcre/pcre_exec.c')
-rw-r--r--pcre/pcre_exec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pcre/pcre_exec.c b/pcre/pcre_exec.c
index c021fe1a4c9..24b23ca2864 100644
--- a/pcre/pcre_exec.c
+++ b/pcre/pcre_exec.c
@@ -6685,7 +6685,8 @@ if (md->offset_vector != NULL)
register int *iend = iptr - re->top_bracket;
if (iend < md->offset_vector + 2) iend = md->offset_vector + 2;
while (--iptr >= iend) *iptr = -1;
- md->offset_vector[0] = md->offset_vector[1] = -1;
+ if (offsetcount > 0) md->offset_vector[0] = -1;
+ if (offsetcount > 1) md->offset_vector[1] = -1;
}
/* Set up the first character to match, if available. The first_char value is