Fix assertion

When we copy onto ovector[MAX_OV_USED] == ovector[MAX_MATCHES * 2], we
want to make sure that we do not exceed the destination, not the source.
parent 6b37c8c3
......@@ -187,7 +187,7 @@ match(VRT_CTX, vre_t *vre, VCL_STRING subject, struct vmod_priv *task,
memset(ov->ovector, -1, sizeof(ov->ovector));
cp = s * 2 * sizeof(*nov);
assert(cp <= sizeof(nov));
assert(cp <= sizeof(ov->ovector));
memcpy(ov->ovector, nov, cp);
return 1;
}
......
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