Commit c07ec357 authored by Geoff Simmons's avatar Geoff Simmons

Assert that the ovector after a backref can never be too small

after using pcre2_match_data_create_from_pattern() to create match_data.
parent afc3167a
......@@ -551,6 +551,13 @@ vmod_regex_backref(VRT_CTX, struct vmod_pcre2_regex *regex, VCL_INT ref,
return (VCL_STRING)buf;
}
/*
* This error is returned when the ovector was too small, cannot
* happen after using pcre2_match_data_create_from_pattern() to
* get the match data block.
*/
assert(ret != PCRE2_ERROR_UNAVAILABLE);
snap = WS_Snapshot(ctx->ws);
if ((msg = WS_Printf(ctx->ws, "in %s.backref(%ld)", regex->vcl_name,
ref)) == NULL)
......
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