Handle NULL string argument to foreach

parent dc6f425d
......@@ -115,7 +115,7 @@ vmod_string_foreach(VRT_CTX, struct VPFX(taskvar_string) *va,
struct vmod_taskvar_string *v =
state_l(ctx, va, sizeof *v);
if (v == NULL)
if (v == NULL || s == NULL)
return;
CHECK_OBJ(v, VMOD_TASKVAR_STRING_MAGIC);
......
......@@ -18,6 +18,7 @@ varnish v1 -vcl {
}
sub vcl_recv {
str.foreach(req.http.null, iter);
str.foreach(req.http.foo, iter);
return (synth(200));
}
......@@ -48,4 +49,4 @@ client c1 {
expect resp.status == 404
} -run
logexpect l1 -wait
\ No newline at end of file
logexpect l1 -wait
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