[master] 119c610 Add a couple of protective asserts

Poul-Henning Kamp phk at FreeBSD.org
Wed Dec 11 11:11:09 CET 2013


commit 119c61073bc3eb097094653a0766ef200fdc6c09
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Dec 11 10:10:53 2013 +0000

    Add a couple of protective asserts

diff --git a/bin/varnishd/cache/cache_busyobj.c b/bin/varnishd/cache/cache_busyobj.c
index 1e735b2..5519168 100644
--- a/bin/varnishd/cache/cache_busyobj.c
+++ b/bin/varnishd/cache/cache_busyobj.c
@@ -221,6 +221,7 @@ VBO_extend(struct busyobj *bo, ssize_t l)
 	assert(l > 0);
 	Lck_Lock(&bo->mtx);
 	st = VTAILQ_LAST(&bo->fetch_obj->store, storagehead);
+	CHECK_OBJ_NOTNULL(st, STORAGE_MAGIC);
 	st->len += l;
 	bo->fetch_obj->len += l;
 	AZ(pthread_cond_signal(&bo->cond));
diff --git a/bin/varnishd/cache/cache_hash.c b/bin/varnishd/cache/cache_hash.c
index 5b90f94..68dbe61 100644
--- a/bin/varnishd/cache/cache_hash.c
+++ b/bin/varnishd/cache/cache_hash.c
@@ -768,6 +768,7 @@ HSH_DerefObjCore(struct dstat *ds, struct objcore **ocp)
 	unsigned r;
 
 	AN(ocp);
+	AN(ds);
 	oc = *ocp;
 	*ocp = NULL;
 



More information about the varnish-commit mailing list