[master] ccc0ca0 Add some protective asserts

Poul-Henning Kamp phk at FreeBSD.org
Mon Aug 14 08:56:05 CEST 2017


commit ccc0ca079aa7657abe241b6488bed641510ed3a5
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Aug 14 06:55:18 2017 +0000

    Add some protective asserts

diff --git a/lib/libvarnishapi/vut.c b/lib/libvarnishapi/vut.c
index 8954b92..68ded26 100644
--- a/lib/libvarnishapi/vut.c
+++ b/lib/libvarnishapi/vut.c
@@ -209,6 +209,11 @@ VUT_Init(const char *progname, int argc, char * const *argv,
     const struct vopt_spec *voc)
 {
 
+	AN(progname);
+	AN(argv);
+	AN(voc);
+	AZ(VUT.progname);
+
 	if (argc == 2 && !strcmp(argv[1], "--synopsis"))
 		exit(vut_synopsis(voc));
 	if (argc == 2 && !strcmp(argv[1], "--options"))
@@ -293,6 +298,8 @@ VUT_Setup(void)
 void
 VUT_Fini(void)
 {
+	AN(VUT.progname);
+
 	free(VUT.n_arg);
 	free(VUT.r_arg);
 	free(VUT.P_arg);



More information about the varnish-commit mailing list