Commit 93c2a0c3 authored by Geoff Simmons's avatar Geoff Simmons

Fail gracefully if backref is called before match(_dyn) in the session

parent aad8afd9
......@@ -217,7 +217,13 @@ vmod_backref(struct sess *sp, struct vmod_priv *priv_vcl, int refnum,
AN(fallback);
CAST_OBJ_NOTNULL(tbl, priv_vcl->priv, SESS_TBL_MAGIC);
assert(sp->id < tbl->nsess);
CHECK_OBJ_NOTNULL(tbl->sess[sp->id], SESS_OV_MAGIC);
if (tbl->sess[sp->id] == NULL) {
WSP(sp, SLT_VCL_error,
"vmod re: backref called without prior match in the "
"session");
return fallback;
}
CHECK_OBJ(tbl->sess[sp->id], SESS_OV_MAGIC);
ov = tbl->sess[sp->id];
if (ov->count <= VRE_ERROR_NOMATCH)
......
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