[6.0] 8e143fbf4 Varnishtest: Allow padding up to and including 255 bytes

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Wed Oct 18 09:21:08 UTC 2023


commit 8e143fbf476aa2231038b47efca7eede62ab2acb
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Tue Jun 22 11:50:07 2021 +0200

    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.

diff --git a/bin/varnishtest/vtc_http2.c b/bin/varnishtest/vtc_http2.c
index b72e53228..5d16f3e15 100644
--- a/bin/varnishtest/vtc_http2.c
+++ b/bin/varnishtest/vtc_http2.c
@@ -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);


More information about the varnish-commit mailing list