Commit a1ed842a authored by Tollef Fog Heen's avatar Tollef Fog Heen

Allow strings longer than 256 bytes

Use an int rather than a char for counting.

Thanks to Thierry for the diagnosis.

Fixes #896
parent 7ef9377d
test "Ticket #896, strings over 256 bytes"
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl+backend {
sub vcl_recv {
if (req.http.host ~ "^(abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij)") {
error 500 "not ok";
}
}
} -start
client c1 {
txreq
rxresp
expect resp.status == 200
} -run
......@@ -350,7 +350,7 @@ static int
vcc_decstr(struct vcc *tl)
{
char *q;
unsigned char l;
unsigned int l;
assert(tl->t->tok == CSTR);
l = (tl->t->e - tl->t->b) - 2;
......
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