[master] d47a144 Add simple error checking in ESI processing

PÃ¥l Hermunn Johansen hermunn at varnish-software.com
Mon Apr 25 15:44:06 CEST 2016


commit d47a144a05cad189dff673ac869ff86f6e80352f
Author: Pål Hermunn Johansen <hermunn at varnish-software.com>
Date:   Tue Apr 19 17:00:24 2016 +0200

    Add simple error checking in ESI processing
    
    When the VEP state machine is in a bad state during finalization
    (VEP_Finish), we log this as an ESI error.

diff --git a/bin/varnishd/cache/cache_esi_parse.c b/bin/varnishd/cache/cache_esi_parse.c
index eac151e..744089a 100644
--- a/bin/varnishd/cache/cache_esi_parse.c
+++ b/bin/varnishd/cache/cache_esi_parse.c
@@ -1052,6 +1052,14 @@ VEP_Finish(struct vep_state *vep)
 	if (vep->attr_vsb)
 		VSB_destroy(&vep->attr_vsb);
 
+	if (vep->state != VEP_START &&
+	    vep->state != VEP_BOM &&
+	    vep->state != VEP_TESTXML &&
+	    vep->state != VEP_NOTXML &&
+	    vep->state != VEP_NEXTTAG) {
+		vep_error(vep, "VEP ended inside a tag");
+	}
+
 	if (vep->o_pending)
 		vep_mark_common(vep, vep->ver_p, vep->last_mark);
 	if (vep->o_wait > 0) {



More information about the varnish-commit mailing list