]> err.no Git - varnish/commitdiff
Until we know of a legitimate use for them, consider non !isgraph()
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 11 Aug 2006 11:22:33 +0000 (11:22 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 11 Aug 2006 11:22:33 +0000 (11:22 +0000)
%xx escapes an error.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@810 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/lib/libvcl/vcc_token.c

index b6ac5e6b6da88b672e479147fb4ee8e027892517..94eabc3661abe5d5c3d8e44ad9345f049d484e94 100644 (file)
@@ -185,6 +185,7 @@ vcc_decstr(struct tokenlist *tl)
 {
        const char *p;
        char *q;
+       unsigned char u;
 
        assert(tl->t->tok == CSTR);
        tl->t->dec = malloc((tl->t->e - tl->t->b) - 1);
@@ -209,7 +210,15 @@ vcc_decstr(struct tokenlist *tl)
                        vcc_ErrWhere(tl, tl->t);
                        return(1);
                }
-               *q++ = vcc_xdig(p[1]) * 16 + vcc_xdig(p[2]);
+               u = vcc_xdig(p[1]) * 16 + vcc_xdig(p[2]);
+               if (!isgraph(u)) {
+                       vcc_AddToken(tl, CSTR, p, p + 3);
+                       vsb_printf(tl->sb,
+                           "Control character in %%xx escape\n");
+                       vcc_ErrWhere(tl, tl->t);
+                       return(1);
+               }
+               *q++ = u;
                p += 3;
        }
        *q++ = '\0';