[master] 9dfcbe3 Don't process a CONTINUATION frame on a closed stream

Dag Haavi Finstad daghf at varnish-software.com
Tue Aug 8 15:49:06 CEST 2017


commit 9dfcbe3394651e4b55183c3e53fdc3eaae06f966
Author: Dag Haavi Finstad <daghf at varnish-software.com>
Date:   Wed Jul 12 16:25:22 2017 +0200

    Don't process a CONTINUATION frame on a closed stream
    
    Fixes: #2350

diff --git a/bin/varnishd/http2/cache_http2_proto.c b/bin/varnishd/http2/cache_http2_proto.c
index 25c18a2..a2892d9 100644
--- a/bin/varnishd/http2/cache_http2_proto.c
+++ b/bin/varnishd/http2/cache_http2_proto.c
@@ -619,8 +619,7 @@ h2_rx_continuation(struct worker *wrk, struct h2_sess *h2, struct h2_req *r2)
 	h2_error h2e;
 
 	ASSERT_RXTHR(h2);
-	AN(r2);
-	if (r2->state != H2_S_OPEN)
+	if (r2 == NULL || r2->state != H2_S_OPEN)
 		return (H2CE_PROTOCOL_ERROR);	// XXX spec ?
 	req = r2->req;
 	h2e = h2h_decode_bytes(h2, r2->decode, h2->rxf_data, h2->rxf_len);
diff --git a/bin/varnishtest/tests/t02003.vtc b/bin/varnishtest/tests/t02003.vtc
index 34b88c2..20b5f3c 100644
--- a/bin/varnishtest/tests/t02003.vtc
+++ b/bin/varnishtest/tests/t02003.vtc
@@ -454,6 +454,20 @@ client c1 {
 	} -run
 } -run
 
+# 2350: Don't accept a continuation frame after stream is closed
+client c1 {
+	stream 1 {
+		txreq
+		rxresp
+		txcont -hdr "foo" "bar"
+	} -run
+
+	stream 0 {
+		rxgoaway
+		expect goaway.err == PROTOCOL_ERROR
+	} -run
+} -run
+
 varnish v1 -vsl_catchup
 
 varnish v1 -expect MEMPOOL.req0.live == 0



More information about the varnish-commit mailing list