[master] ad3f134 Add some asserts to help catch #886

Poul-Henning Kamp phk at varnish-cache.org
Thu Mar 31 22:02:37 CEST 2011


commit ad3f1341c4960ecf12499c0ca0debb5bfd962e26
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Mar 31 20:02:24 2011 +0000

    Add some asserts to help catch #886

diff --git a/bin/varnishd/cache_ban.c b/bin/varnishd/cache_ban.c
index 4480c98..f156018 100644
--- a/bin/varnishd/cache_ban.c
+++ b/bin/varnishd/cache_ban.c
@@ -434,6 +434,7 @@ ban_check_object(struct object *o, const struct sess *sp, int has_req)
 	CHECK_OBJ_NOTNULL(oc->ban, BAN_MAGIC);
 
 	b0 = ban_start;
+	CHECK_OBJ_NOTNULL(b0, BAN_MAGIC);
 
 	if (b0 == oc->ban)
 		return (0);
@@ -445,6 +446,7 @@ ban_check_object(struct object *o, const struct sess *sp, int has_req)
 	 */
 	tests = 0;
 	for (b = b0; b != oc->ban; b = VTAILQ_NEXT(b, list)) {
+		CHECK_OBJ_NOTNULL(b, BAN_MAGIC);
 		if (b->flags & BAN_F_GONE)
 			continue;
 		if (!has_req && (b->flags & BAN_F_REQ))



More information about the varnish-commit mailing list