Commit 8bed7223 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Fix error handling of unterminated long-strings.



git-svn-id: http://www.varnish-cache.org/svn/trunk@3258 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 42117197
......@@ -400,18 +400,19 @@ vcc_Lexer(struct tokenlist *tl, struct source *sp)
for (q = p + 2; q < sp->e; q++) {
if (*q == '"' && q[1] == '}') {
vcc_AddToken(tl, CSTR, p, q + 2);
p = q + 2;
break;
}
}
u = tl->t->e - tl->t->b;
u -= 4; /* {" ... "} */
tl->t->dec = TlAlloc(tl, u + 1 );
AN(tl->t->dec);
memcpy(tl->t->dec, tl->t->b + 2, u);
tl->t->dec[u] = '\0';
if (q < sp->e)
if (q < sp->e) {
p = q + 2;
u = tl->t->e - tl->t->b;
u -= 4; /* {" ... "} */
tl->t->dec = TlAlloc(tl, u + 1 );
AN(tl->t->dec);
memcpy(tl->t->dec, tl->t->b + 2, u);
tl->t->dec[u] = '\0';
continue;
}
vcc_AddToken(tl, EOI, p, p + 2);
vsb_printf(tl->sb,
"Unterminated long-string, starting at\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment