[master] 8e36cb707 vrt: Make sure VRT_Rollback() has a snapshot

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Fri Aug 27 15:35:07 UTC 2021


commit 8e36cb707c3b003ed7764731cc55b1cf80a2afa2
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Fri Aug 27 17:31:28 2021 +0200

    vrt: Make sure VRT_Rollback() has a snapshot
    
    Otherwise we would entirely unravel the task workspace.

diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index 6f6f3d637..16ab14558 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -153,6 +153,7 @@ Bereq_Rollback(VRT_CTX)
 	HTTP_Clone(bo->bereq, bo->bereq0);
 	bo->vfp_filter_list = NULL;
 	bo->err_reason = NULL;
+	AN(bo->ws_bo);
 	WS_Rollback(bo->ws, bo->ws_bo);
 }
 
diff --git a/bin/varnishd/cache/cache_req.c b/bin/varnishd/cache/cache_req.c
index 5a5e752f7..cff1d0470 100644
--- a/bin/varnishd/cache/cache_req.c
+++ b/bin/varnishd/cache/cache_req.c
@@ -209,6 +209,7 @@ Req_Rollback(VRT_CTX)
 	req->filter_list = NULL;
 	if (WS_Overflowed(req->ws))
 		req->wrk->stats->ws_client_overflow++;
+	AN(req->ws_req);
 	WS_Rollback(req->ws, req->ws_req);
 }
 


More information about the varnish-commit mailing list