From 9f12e553def56a82ddd76338929501d7fdaa149c Mon Sep 17 00:00:00 2001 From: phk Date: Thu, 10 Jul 2008 20:49:45 +0000 Subject: [PATCH] Fix two bugs in esi parsing: Ignore unknown include attributes and Warn about src attributes without value git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2924 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_vrt_esi.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/varnish-cache/bin/varnishd/cache_vrt_esi.c b/varnish-cache/bin/varnishd/cache_vrt_esi.c index e7897f0e..63908cea 100644 --- a/varnish-cache/bin/varnishd/cache_vrt_esi.c +++ b/varnish-cache/bin/varnishd/cache_vrt_esi.c @@ -277,10 +277,13 @@ esi_addinclude(struct esi_work *ew, txt t) VSL(SLT_Debug, 0, "<%.*s> -> <%.*s>", tag.e - tag.b, tag.b, val.e - val.b, val.b); - if (Tlen(tag) != 3 && memcmp(tag.b, "src", 3)) + if (Tlen(tag) != 3 || memcmp(tag.b, "src", 3)) + continue; + if (Tlen(val) == 0) { + esi_error(ew, tag.b, Tlen(tag), + "ESI esi:include src attribute withou value"); continue; - - assert(Tlen(val) > 0); /* XXX */ + } if (Tlen(val) > 7 && !memcmp(val.b, "http://", 7)) { /* Rewrite to Host: header inplace */ -- 2.39.5