Commit 4e3aa514 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Lasse Karstensen

Escape question marks in C-strings to avoid accidentally generating

tri-graphs.

Fixes #1566
parent 1c64de28
varnishtest "escape issue in regexp"
varnish v1 -vcl {
backend b1 { .host = "127.0.0.1"; }
sub vcl_recv {
set req.url = regsuball(req.url, "\??(p|pi)=.*?(&|$)", "");
}
}
......@@ -211,6 +211,7 @@ EncString(struct vsb *sb, const char *b, const char *e, int mode)
VSB_cat(sb, "\"");
for (; b < e; b++) {
switch (*b) {
case '?': // Trigraphs
case '\\':
case '"':
VSB_printf(sb, "\\%c", *b);
......
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