%xx escapes an error.
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@810
d4fa192b-c00b-0410-8231-
f00ffab90ce4
{
const char *p;
char *q;
+ unsigned char u;
assert(tl->t->tok == CSTR);
tl->t->dec = malloc((tl->t->e - tl->t->b) - 1);
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';