From: phk Date: Thu, 10 Jul 2008 21:11:11 +0000 (+0000) Subject: Tackle another XML/ESI syntax error corner-case: X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07c7508acc920db3035a1ec9fe6076edbd0a5077;p=varnish Tackle another XML/ESI syntax error corner-case: would result in a NUL byte when looking for the next attribute. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2926 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_vrt_esi.c b/varnish-cache/bin/varnishd/cache_vrt_esi.c index 63908cea..524c06ed 100644 --- a/varnish-cache/bin/varnishd/cache_vrt_esi.c +++ b/varnish-cache/bin/varnishd/cache_vrt_esi.c @@ -189,6 +189,7 @@ static int esi_attrib(const struct esi_work *ew, txt *in, txt *attrib, txt *val) { + AN(*in->b); /* Skip leading blanks */ while(in->b < in->e && isspace(*in->b)) in->b++; @@ -224,6 +225,13 @@ esi_attrib(const struct esi_work *ew, txt *in, txt *attrib, txt *val) /* skip '=' */ in->b++; + if (isspace(*in->b)) { + val->e = val->b = in->b;; + *val->e = '\0'; + in->b++; + return (1); + } + /* Value, if any ? */ *val = *in; if (in->b >= in->e)