[master] b3799d224 Add a cast for FlexeLint

Poul-Henning Kamp phk at FreeBSD.org
Mon May 31 17:13:05 UTC 2021


commit b3799d22442ce341ac7d2a8991644f760bd8ebf0
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon May 31 17:06:44 2021 +0000

    Add a cast for FlexeLint

diff --git a/bin/varnishd/storage/storage_malloc.c b/bin/varnishd/storage/storage_malloc.c
index 93dd52747..013d5e58d 100644
--- a/bin/varnishd/storage/storage_malloc.c
+++ b/bin/varnishd/storage/storage_malloc.c
@@ -75,7 +75,7 @@ sma_alloc(const struct stevedore *st, size_t size)
 	CAST_OBJ_NOTNULL(sma_sc, st->priv, SMA_SC_MAGIC);
 	Lck_Lock(&sma_sc->sma_mtx);
 	sma_sc->stats->c_req++;
-	if (sma_sc->sma_alloc + size > sma_sc->sma_max) {
+	if (sma_sc->sma_alloc + (VCL_BYTES)size > sma_sc->sma_max) {
 		sma_sc->stats->c_fail++;
 		size = 0;
 	} else {


More information about the varnish-commit mailing list