r2926 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Thu Jul 10 23:11:12 CEST 2008


Author: phk
Date: 2008-07-10 23:11:11 +0200 (Thu, 10 Jul 2008)
New Revision: 2926

Modified:
   trunk/varnish-cache/bin/varnishd/cache_vrt_esi.c
Log:
Tackle another XML/ESI syntax error corner-case:
	<esi:include  src= />
would result in a NUL byte when looking for the next attribute.



Modified: trunk/varnish-cache/bin/varnishd/cache_vrt_esi.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_vrt_esi.c	2008-07-10 20:50:04 UTC (rev 2925)
+++ trunk/varnish-cache/bin/varnishd/cache_vrt_esi.c	2008-07-10 21:11:11 UTC (rev 2926)
@@ -189,6 +189,7 @@
 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 @@
 	/* 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) 




More information about the varnish-commit mailing list