r4434 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Thu Jan 7 12:29:57 CET 2010


Author: phk
Date: 2010-01-07 12:29:56 +0100 (Thu, 07 Jan 2010)
New Revision: 4434

Modified:
   trunk/varnish-cache/bin/varnishd/cache_esi.c
Log:
Correctly check the XML 1.0 names for illegal characters.

Fixes #207



Modified: trunk/varnish-cache/bin/varnishd/cache_esi.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_esi.c	2010-01-07 11:29:28 UTC (rev 4433)
+++ trunk/varnish-cache/bin/varnishd/cache_esi.c	2010-01-07 11:29:56 UTC (rev 4434)
@@ -53,6 +53,7 @@
 #include "shmlog.h"
 #include "vrt.h"
 #include "vcl.h"
+#include "vct.h"
 #include "cache.h"
 #include "stevedore.h"
 
@@ -314,16 +315,17 @@
 	if (in->b >= in->e)
 		return (0);
 
-	if (!isalpha(*in->b)) {
+	if (!vct_isxmlnamestart(*in->b)) {
 		/* XXX error */
-		esi_error(ew, in->b, 1, "XML 1.0 Illegal attribute character");
+		esi_error(ew, in->b, 1,
+		    "XML 1.0 Illegal attribute start character");
 		return (-1);
 	}
 
 	/* Attribute name until '=' or space */
 	*attrib = *in;
 	while(in->b < in->e && *in->b != '=' && !isspace(*in->b)) {
-		if (!isalnum(*in->b)) {
+		if (!vct_isxmlname(*in->b)) {
 			esi_error(ew, attrib->b, 1 + (in->b - attrib->b),
 			    "XML 1.0 Illegal attribute character");
 			return (-1);



More information about the varnish-commit mailing list