[master] b550ef4b0 avoid asserting in VSA_Sane()

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


commit b550ef4b0f6238262a35d047cb8d2f4a8f4caaa3
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Mon Oct 5 14:29:36 2020 +0200

    avoid asserting in VSA_Sane()
    
    so far, it is only used in assertions - this change enables use in
    panic code.

diff --git a/lib/libvarnish/vsa.c b/lib/libvarnish/vsa.c
index a46e8ac08..a604d4201 100644
--- a/lib/libvarnish/vsa.c
+++ b/lib/libvarnish/vsa.c
@@ -357,8 +357,7 @@ VSA_Get_Proto(const struct suckaddr *sua)
 int
 VSA_Sane(const struct suckaddr *sua)
 {
-	CHECK_OBJ_NOTNULL(sua, SUCKADDR_MAGIC);
-	return (sua_len(&sua->sa) != 0);
+	return (VALID_OBJ(sua, SUCKADDR_MAGIC) && sua_len(&sua->sa) != 0);
 }
 
 int


More information about the varnish-commit mailing list