[master] 01b73e018 vai: fix glitch from 84d1fc92f436e9c94d127ec45e779b36f0f7c2a7

Nils Goroll nils.goroll at uplex.de
Mon Jul 7 13:17:06 UTC 2025


commit 01b73e0182de168514becb15dede383311810a0e
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Mon Jul 7 15:06:59 2025 +0200

    vai: fix glitch from 84d1fc92f436e9c94d127ec45e779b36f0f7c2a7
    
    If even if we do not hand hdl->last to the caller to return because we are in a
    finished or error bos state, we are still done with it and need to clear it for
    re-use.
    
    Fixes #4356

diff --git a/bin/varnishd/storage/storage_simple.c b/bin/varnishd/storage/storage_simple.c
index 6ea4821f8..f4a5ec67f 100644
--- a/bin/varnishd/storage/storage_simple.c
+++ b/bin/varnishd/storage/storage_simple.c
@@ -506,8 +506,9 @@ sml_ai_lease_boc(struct worker *wrk, vai_hdl vhdl, struct vscarab *scarab)
 		viov->iov.iov_base = null_iov;
 		viov->iov.iov_len = 0;
 		viov->lease = st2lease(hdl->last);
-		hdl->last = NULL;
 	}
+	if (hdl->last != NULL)
+		hdl->last = NULL;
 	if (hdl->st == NULL) {
 		assert(hdl->returned == 0 || hdl->avail == hdl->returned);
 		hdl->st = VTAILQ_LAST(&hdl->obj->list, storagehead);


More information about the varnish-commit mailing list