Commit 7c11069a by Nils Goroll

Handle VRT_priv_task errors gracefully

The reason is the same as for
https://github.com/varnishcache/varnish-cache/issues/2708 :

VRT_priv_task may now return NULL for out-of-workspace errors, see
https://github.com/varnishcache/varnish-cache/commit/de2b431086a13b243dc8b3e71cd8697db1df2c7f
parent 79324c59
......@@ -286,6 +286,12 @@ vmod_regex_match(VRT_CTX, struct vmod_re_regex *re, VCL_STRING subject,
AN(re->vre);
task = VRT_priv_task(ctx, re);
if (task == NULL) {
errmsg(ctx, "vmod re: no priv - out of workspace?");
return (0);
}
AN(task);
task->len = 0;
......@@ -302,6 +308,10 @@ vmod_regex_backref(VRT_CTX, struct vmod_re_regex *re, VCL_INT refnum,
CHECK_OBJ_NOTNULL(re, VMOD_RE_REGEX_MAGIC);
task = VRT_priv_task(ctx, re);
if (task == NULL) {
errmsg(ctx, "vmod re: no priv - out of workspace?");
return (0);
}
return backref(ctx, refnum, fallback, task);
}
......
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