Commit f8f75cb1 authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Don't panic on malformed Vary headers.

Fixes: #1275

Test case by: Dag Haavi Finstad
parent e316a5fb
...@@ -130,7 +130,11 @@ VRY_Create(struct req *req, const struct http *hp, struct vsb **psb) ...@@ -130,7 +130,11 @@ VRY_Create(struct req *req, const struct http *hp, struct vsb **psb)
q++; q++;
if (*q == '\0') if (*q == '\0')
break; break;
xxxassert(*q == ','); if (*q != ',') {
VSLb(req->vsl, SLT_Error, "Malformed Vary header");
error = 1;
break;
}
p = q; p = q;
} }
......
varnishtest "#1275 - panic with malformed Vary header"
server s1 {
rxreq
txresp -hdr "Vary: foo bar"
} -start
varnish v1 -vcl+backend { } -start
client c1 {
txreq
rxresp
expect resp.status == 503
} -run
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