[master] b99c0bedd fix missing initialization

Nils Goroll nils.goroll at uplex.de
Sat Jan 18 13:25:06 UTC 2020


commit b99c0bedd0990cd171a48ab883debdf5e2172d7e
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Sat Jan 18 14:19:10 2020 +0100

    fix missing initialization
    
    ... introduced with 3bb8b84cd86a4d2b95c7e2508ace6d868ced412c:
    
    in Pool_Work_Thread(), we could break out of the for (i = 0; i <
    TASK_QUEUE__END; i++) loop with tp set to the value from the previous
    iteration of the top while() loop where if should have been NULL (for no
    task found).
    
    Noticed staring at #3192 - unclear yet if related

diff --git a/bin/varnishd/cache/cache_wrk.c b/bin/varnishd/cache/cache_wrk.c
index d66bfa809..15558adf7 100644
--- a/bin/varnishd/cache/cache_wrk.c
+++ b/bin/varnishd/cache/cache_wrk.c
@@ -335,7 +335,7 @@ pool_kiss_of_death(struct worker *wrk, void *priv)
 static void
 Pool_Work_Thread(struct pool *pp, struct worker *wrk)
 {
-	struct pool_task *tp = NULL;
+	struct pool_task *tp;
 	struct pool_task tpx, tps;
 	vtim_real tmo;
 	int i, reserve;
@@ -344,6 +344,7 @@ Pool_Work_Thread(struct pool *pp, struct worker *wrk)
 	wrk->pool = pp;
 	while (1) {
 		CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
+		tp = NULL;
 
 		WS_Reset(wrk->aws, 0);
 		AZ(wrk->vsl);


More information about the varnish-commit mailing list