summaryrefslogtreecommitdiff
path: root/pcre_exec.c
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2015-06-09 16:46:52 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2015-06-09 16:46:52 +0000
commitb5c4f0f2bef3a0dff74e4de806b8b5280bb666c0 (patch)
tree124b7f97770ac44b7c5f3a8e956e0c88bd306d3d /pcre_exec.c
parent851af6faeda1df4db6977f60b8f7f8abd72dc6c5 (diff)
downloadpcre-b5c4f0f2bef3a0dff74e4de806b8b5280bb666c0.tar.gz
Fix overflow when ovector has size 1.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1565 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'pcre_exec.c')
-rw-r--r--pcre_exec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pcre_exec.c b/pcre_exec.c
index c021fe1..24b23ca 100644
--- a/pcre_exec.c
+++ b/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