[master] 432ebd5 Add a couple of asserts to explain stuff to Coverity

Poul-Henning Kamp phk at varnish-cache.org
Wed Oct 2 08:54:03 CEST 2013


commit 432ebd54043b3c0a74a2a1e03e7876c3ed9bb95d
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Oct 2 06:53:47 2013 +0000

    Add a couple of asserts to explain stuff to Coverity

diff --git a/bin/varnishd/cache/cache_esi_parse.c b/bin/varnishd/cache/cache_esi_parse.c
index e173b93..880d3d2 100644
--- a/bin/varnishd/cache/cache_esi_parse.c
+++ b/bin/varnishd/cache/cache_esi_parse.c
@@ -926,6 +926,7 @@ VEP_Parse(const struct busyobj *bo, const char *p, size_t l)
 			 * Match against a table while split over input
 			 * sections.
 			 */
+			AN(vep->match);
 			do {
 				if (*p == '>') {
 					for (vm = vep->match;
diff --git a/bin/varnishd/storage/storage_persistent_subr.c b/bin/varnishd/storage/storage_persistent_subr.c
index 0589af9..bfe6b40 100644
--- a/bin/varnishd/storage/storage_persistent_subr.c
+++ b/bin/varnishd/storage/storage_persistent_subr.c
@@ -139,6 +139,7 @@ smp_reset_sign(struct smp_signctx *ctx)
 {
 
 	memset(ctx->ss, 0, sizeof *ctx->ss);
+	assert(strlen(ctx->id) < sizeof *ctx->ss);
 	strcpy(ctx->ss->ident, ctx->id);
 	ctx->ss->unique = ctx->unique;
 	ctx->ss->mapped = (uintptr_t)ctx->ss;



More information about the varnish-commit mailing list