]> err.no Git - varnish/commitdiff
Tackle another XML/ESI syntax error corner-case:
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 10 Jul 2008 21:11:11 +0000 (21:11 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 10 Jul 2008 21:11:11 +0000 (21:11 +0000)
<esi:include  src= />
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

varnish-cache/bin/varnishd/cache_vrt_esi.c

index 63908cea3f5b58a4aa9a4a7c6225cccaba2687e1..524c06ed8fabbe2b4eaf93c3c9286986f81eac30 100644 (file)
@@ -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)