[6.0] 92455b9c5 assert for VGZ_NewGzip() failures

Reza Naghibi reza at naghibi.com
Tue Jun 2 15:06:08 UTC 2020


commit 92455b9c5782679ba8a2d24e7013ea00f3cd2a4d
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Thu Mar 19 10:52:15 2020 +0100

    assert for VGZ_NewGzip() failures
    
    VGZ_NewGzip will either assert or succeed.

diff --git a/bin/varnishd/cache/cache_esi_fetch.c b/bin/varnishd/cache/cache_esi_fetch.c
index 3852dec88..575685603 100644
--- a/bin/varnishd/cache/cache_esi_fetch.c
+++ b/bin/varnishd/cache/cache_esi_fetch.c
@@ -170,6 +170,7 @@ vfp_esi_gzip_init(struct vfp_ctx *vc, struct vfp_entry *vfe)
 		return (VFP_ERROR);
 	}
 	vef->vgz = VGZ_NewGzip(vc->wrk->vsl, "G F E");
+	AN(vef->vgz);
 
 	vef->ibuf_sz = cache_param->gzip_buffer;
 	vef->ibuf = calloc(1L, vef->ibuf_sz);
diff --git a/bin/varnishd/cache/cache_gzip.c b/bin/varnishd/cache/cache_gzip.c
index 6483a6758..390c9bae9 100644
--- a/bin/varnishd/cache/cache_gzip.c
+++ b/bin/varnishd/cache/cache_gzip.c
@@ -479,8 +479,7 @@ vfp_gzip_init(struct vfp_ctx *vc, struct vfp_entry *vfe)
 			vc->obj_flags |= OF_GZIPED;
 		}
 	}
-	if (vg == NULL)
-		return (VFP_ERROR);
+	AN(vg);
 	vfe->priv1 = vg;
 	if (vgz_getmbuf(vg))
 		return (VFP_ERROR);


More information about the varnish-commit mailing list