[master] 46901a4d3 avoid potential assertion failures in pan_addr()

Nils Goroll nils.goroll at uplex.de
Mon Oct 5 12:38:06 UTC 2020


commit 46901a4d32901fd140441046cdf79783391e9a17
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Mon Oct 5 14:35:27 2020 +0200

    avoid potential assertion failures in pan_addr()
    
    ref 8816c6f9df513ba90ec60712ba629c78fa75ec9c

diff --git a/bin/varnishd/cache/cache_panic.c b/bin/varnishd/cache/cache_panic.c
index 7364bfdf7..6d7aa5afa 100644
--- a/bin/varnishd/cache/cache_panic.c
+++ b/bin/varnishd/cache/cache_panic.c
@@ -53,6 +53,7 @@
 #include "vtim.h"
 #include "vcs.h"
 #include "vtcp.h"
+#include "vsa.h"
 
 /*
  * The panic string is constructed in a VSB, then copied to the
@@ -540,6 +541,8 @@ pan_req(struct vsb *vsb, const struct req *req)
 		char p[VTCP_PORTBUFSIZE];				\
 									\
 		(void) SES_Get_##field##_addr((sp), &sa);		\
+		if (! VSA_Sane(sa))					\
+			break;						\
 		VTCP_name(sa, h, sizeof h, p, sizeof p);		\
 		VSB_printf((vsb), "%s.ip = %s:%s,\n", #field, h, p);	\
 	} while (0)


More information about the varnish-commit mailing list