[master] 281c818 Clarify a pointers value for FlexeLint

Poul-Henning Kamp phk at varnish-cache.org
Wed Mar 9 13:52:58 CET 2011


commit 281c81870d9c6ba1a75ff685e425bccc12d771e7
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Mar 9 12:52:46 2011 +0000

    Clarify a pointers value for FlexeLint

diff --git a/bin/varnishd/cache_dir_random.c b/bin/varnishd/cache_dir_random.c
index 45a74d0..9727232 100644
--- a/bin/varnishd/cache_dir_random.c
+++ b/bin/varnishd/cache_dir_random.c
@@ -90,7 +90,7 @@ vdi_random_getfd(const struct director *d, struct sess *sp)
 	struct vbc *vbe;
 	struct director *d2;
 	struct SHA256Context ctx;
-	uint8_t sign[SHA256_LEN], *hp;
+	uint8_t sign[SHA256_LEN], *hp = NULL;
 
 	CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
 	CHECK_OBJ_NOTNULL(d, DIRECTOR_MAGIC);
@@ -128,6 +128,7 @@ vdi_random_getfd(const struct director *d, struct sess *sp)
 	 * amongst the healthy set.
 	 */
 	if (vs->criteria != c_random) {
+		AN(hp);
 		u = vle32dec(hp);
 		r = u / 4294967296.0;
 		assert(r >= 0.0 && r < 1.0);



More information about the varnish-commit mailing list