[4.0] 6deca86 Avoid assertion failure in VCC if the first symbol encountered in VCL is not an ID

Lasse Karstensen lkarsten at varnish-software.com
Thu Jan 15 16:35:40 CET 2015


commit 6deca8631c33d3075e123f1ce742286af42ffbf1
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Mon Oct 27 21:01:55 2014 +0100

    Avoid assertion failure in VCC if the first symbol encountered in VCL is not an ID
    
    Trivial test VCL:
    
    	C{ }C; vcl 4.0;

diff --git a/lib/libvcc/vcc_parse.c b/lib/libvcc/vcc_parse.c
index dab1131..2b52846 100644
--- a/lib/libvcc/vcc_parse.c
+++ b/lib/libvcc/vcc_parse.c
@@ -338,7 +338,7 @@ vcc_Parse(struct vcc *tl)
 {
 	struct toplev *tp;
 
-	if (!vcc_IdIs(tl->t, "vcl")) {
+	if (tl->t->tok != ID || !vcc_IdIs(tl->t, "vcl")) {
 		VSB_printf(tl->sb,
 		    "VCL version declaration missing\n"
 		    "Update your VCL to Version 4 syntax, and add\n"



More information about the varnish-commit mailing list