[master] 6a969b2c0 A more friendly overrun panic for VSL consumers

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Mon Jul 15 16:56:08 UTC 2019


commit 6a969b2c0309c639e2ba5410d5f1733c9e4ad64c
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Mon Jul 15 18:50:34 2019 +0200

    A more friendly overrun panic for VSL consumers

diff --git a/lib/libvarnishapi/vsl_dispatch.c b/lib/libvarnishapi/vsl_dispatch.c
index 4bef6b233..e563ef751 100644
--- a/lib/libvarnishapi/vsl_dispatch.c
+++ b/lib/libvarnishapi/vsl_dispatch.c
@@ -274,6 +274,7 @@ vslc_vtx_next(const struct VSL_cursor *cursor)
 {
 	struct vslc_vtx *c;
 	const uint32_t *ptr;
+	unsigned overrun;
 
 	CAST_OBJ_NOTNULL(c, cursor->priv_data, VSLC_VTX_MAGIC);
 	assert(&c->cursor == cursor);
@@ -287,7 +288,8 @@ vslc_vtx_next(const struct VSL_cursor *cursor)
 			c->cursor.rec.ptr = c->synth->data;
 			c->synth = VTAILQ_NEXT(c->synth, list);
 		} else {
-			assert(c->offset <= c->vtx->len);
+			overrun = c->offset > c->vtx->len;
+			AZ(overrun);
 			if (c->offset == c->vtx->len)
 				return (vsl_end);
 


More information about the varnish-commit mailing list