]> err.no Git - varnish/commitdiff
Fix error handling of unterminated long-strings.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 5 Oct 2008 22:40:16 +0000 (22:40 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 5 Oct 2008 22:40:16 +0000 (22:40 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3258 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/lib/libvcl/vcc_token.c

index 787ed188066d162d35cc6f859702f985d3b34e22..d8960760f136f9bdfdb4cb87e70b40cca35427fb 100644 (file)
@@ -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");