Commit 8e143fbf authored by Martin Blix Grydeland's avatar Martin Blix Grydeland Committed by Dridi Boukelmoune

Varnishtest: Allow padding up to and including 255 bytes

According to the spec the padding is an 8-bit field, and fields should be
treated as unsigned unless otherwise specified, which it is not for any of
the padding related places. Allow varnishtest to generate padding up to
255 bytes long.
parent c581caba
......@@ -1565,8 +1565,8 @@ cmd_tx11obj(CMD_ARGS)
exclusive_stream_dependency(s);
}
if (pad) {
if (strlen(pad) >= 128)
vtc_fatal(vl, "Padding is limited to 128 bytes");
if (strlen(pad) > 255)
vtc_fatal(vl, "Padding is limited to 255 bytes");
f.flags |= PADDED;
assert(f.size + strlen(pad) < BUF_SIZE);
memmove(buf + 1, buf, f.size);
......@@ -1659,8 +1659,8 @@ cmd_txdata(CMD_ARGS)
if (pad) {
f.flags |= PADDED;
if (strlen(pad) >= 128)
vtc_fatal(vl, "Padding is limited to 128 bytes");
if (strlen(pad) > 255)
vtc_fatal(vl, "Padding is limited to 255 bytes");
data = malloc( 1 + strlen(body) + strlen(pad));
AN(data);
*((uint8_t *)data) = strlen(pad);
......
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