[master] 09f96b5 Add a couple of (needless) asserts for Coveritys sake.

Poul-Henning Kamp phk at FreeBSD.org
Thu Feb 23 09:55:05 CET 2017


commit 09f96b5e64e80db5aa3d3eef6f37895da065e926
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Feb 23 08:54:13 2017 +0000

    Add a couple of (needless) asserts for Coveritys sake.

diff --git a/bin/varnishtest/vtc_http.c b/bin/varnishtest/vtc_http.c
index d9a233d..60af496 100644
--- a/bin/varnishtest/vtc_http.c
+++ b/bin/varnishtest/vtc_http.c
@@ -1414,6 +1414,7 @@ cmd_http_sendhex(CMD_ARGS)
 	AN(av[1]);
 	AZ(av[2]);
 	vsb = vtc_hex_to_bin(hp->vl, av[1]);
+	assert(VSB_len(vsb) >= 0);
 	vtc_hexdump(hp->vl, 4, "sendhex", VSB_data(vsb), VSB_len(vsb));
 	j = write(hp->fd, VSB_data(vsb), VSB_len(vsb));
 	assert(j == VSB_len(vsb));
diff --git a/bin/varnishtest/vtc_http2.c b/bin/varnishtest/vtc_http2.c
index ee6f9c3..5f6701c 100644
--- a/bin/varnishtest/vtc_http2.c
+++ b/bin/varnishtest/vtc_http2.c
@@ -1237,6 +1237,7 @@ cmd_sendhex(CMD_ARGS)
 	AN(av[1]);
 	AZ(av[2]);
 	vsb = vtc_hex_to_bin(hp->vl, av[1]);
+	assert(VSB_len(vsb) >= 0);
 	vtc_hexdump(hp->vl, 4, "sendhex", VSB_data(vsb), VSB_len(vsb));
 	AZ(pthread_mutex_lock(&hp->mtx));
 	http_write(hp, 4, VSB_data(vsb), VSB_len(vsb), "sendhex");



More information about the varnish-commit mailing list