Commit ee80f8d8 authored by Geoff Simmons's avatar Geoff Simmons

Fix an off-by-one error in set.matched().

Fixes gitlab issue #1.
parent 2dc5d5f7
......@@ -547,7 +547,7 @@ vmod_set_matched(VRT_CTX, struct vmod_re2_set *set, VCL_INT n)
WS_Assert_Allocated(ctx->ws, task->matches,
task->nmatches * sizeof(int));
n--;
hi = task->nmatches;
hi = task->nmatches - 1;
do {
int m = lo + (hi - lo) / 2;
if (task->matches[m] == n)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment