[master] b63725c3d vtc_http2: Don't leak ignored window updates

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Mon Aug 30 10:59:05 UTC 2021


commit b63725c3d5e39eee67b40f1fb169e73d13a24c28
Author: Asad Sajjad Ahmed <asadsa at varnish-software.com>
Date:   Mon Aug 30 12:49:15 2021 +0200

    vtc_http2: Don't leak ignored window updates
    
    Refs #3442
    Refs #3661

diff --git a/bin/varnishtest/vtc_http2.c b/bin/varnishtest/vtc_http2.c
index 297045ff9..2cdb34a68 100644
--- a/bin/varnishtest/vtc_http2.c
+++ b/bin/varnishtest/vtc_http2.c
@@ -2291,7 +2291,7 @@ static void
 cmd_rxmsg(CMD_ARGS)
 {
 	struct stream *s;
-	struct frame *f;
+	struct frame *f = NULL;
 	int end_stream;
 	int rcv = 0;
 
@@ -2303,8 +2303,9 @@ cmd_rxmsg(CMD_ARGS)
 		ONLY_H2_CLIENT(s->hp, av);
 
 	do {
-		f = rxstuff(s);
-		if (!f)
+		replace_frame(&f, rxstuff(s));
+		CHECK_OBJ_ORNULL(f, FRAME_MAGIC);
+		if (f == NULL)
 			return;
 	} while (f->type == TYPE_WINDOW_UPDATE);
 
@@ -2315,6 +2316,7 @@ cmd_rxmsg(CMD_ARGS)
 
 	while (!(f->flags & END_HEADERS)) {
 		replace_frame(&f, rxstuff(s));
+		CHECK_OBJ_ORNULL(f, FRAME_MAGIC);
 		if (f == NULL)
 			return;
 		rcv++;
@@ -2323,6 +2325,7 @@ cmd_rxmsg(CMD_ARGS)
 
 	while (!end_stream) {
 		replace_frame(&f, rxstuff(s));
+		CHECK_OBJ_ORNULL(f, FRAME_MAGIC);
 		if (f == NULL)
 			break;
 		rcv++;


More information about the varnish-commit mailing list