[6.0] 8f8c85c4a Add an assert that the status is valid on entry to h2_build_headers

Reza Naghibi reza at naghibi.com
Wed May 20 13:55:08 UTC 2020


commit 8f8c85c4a9cf485c8013623041511fa8f7e3b0aa
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Tue May 5 13:36:22 2020 +0200

    Add an assert that the status is valid on entry to h2_build_headers
    
    Conflicts:
        bin/varnishd/http2/cache_http2_deliver.c

diff --git a/bin/varnishd/http2/cache_http2_deliver.c b/bin/varnishd/http2/cache_http2_deliver.c
index ee255067e..ee9f40cb2 100644
--- a/bin/varnishd/http2/cache_http2_deliver.c
+++ b/bin/varnishd/http2/cache_http2_deliver.c
@@ -238,6 +238,7 @@ h2_build_headers(struct vsb *resp, struct req *req)
 
 	AN(VSB_new(resp, req->ws->f, l, VSB_FIXEDLEN));
 
+	assert(req->resp->status % 1000 >= 100);
 	l = h2_status(buf, req->resp->status % 1000);
 	VSB_bcat(resp, buf, l);
 


More information about the varnish-commit mailing list