Handle NULL string argument to foreach

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