[6.0] ded79885b Fix assertion for PUSH_PROMISE frames

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Wed Oct 31 13:08:27 UTC 2018


commit ded79885b7aef4da453254240f709d9fe4a872a0
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Fri Oct 5 12:09:28 2018 +0200

    Fix assertion for PUSH_PROMISE frames
    
    r2 can be either null or not.
    
    Test case by @daghf
    
    Refs #2781

diff --git a/bin/varnishd/http2/cache_http2_proto.c b/bin/varnishd/http2/cache_http2_proto.c
index 6caa358bf..7d040b7d0 100644
--- a/bin/varnishd/http2/cache_http2_proto.c
+++ b/bin/varnishd/http2/cache_http2_proto.c
@@ -305,7 +305,7 @@ h2_rx_push_promise(struct worker *wrk, struct h2_sess *h2, struct h2_req *r2)
 
 	CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
 	ASSERT_RXTHR(h2);
-	CHECK_OBJ_NOTNULL(r2, H2_REQ_MAGIC); /* XXX: wasteful allocation? */
+	CHECK_OBJ_ORNULL(r2, H2_REQ_MAGIC);
 	// rfc7540,l,2262,2267
 	return (H2CE_PROTOCOL_ERROR);
 }
diff --git a/bin/varnishtest/tests/t02003.vtc b/bin/varnishtest/tests/t02003.vtc
index 215171cf6..1d62ac986 100644
--- a/bin/varnishtest/tests/t02003.vtc
+++ b/bin/varnishtest/tests/t02003.vtc
@@ -173,6 +173,21 @@ client c1 {
 	stream 0 -wait
 } -run
 
+client c1 {
+	stream 0 {
+		rxgoaway
+		expect goaway.err == PROTOCOL_ERROR
+		expect goaway.laststream == 1
+	} -start
+	stream 1 {
+		txreq
+		rxresp
+		delay .1
+		# send a PUSH_PROMISE after a request
+		sendhex "000008 05 00 00000001 0001020304050607"
+	} -start
+} -run
+
 varnish v1 -vsl_catchup
 
 varnish v1 -expect MEMPOOL.req0.live == 0


More information about the varnish-commit mailing list