[Varnish] #1566: escape sequence breaks regex

Varnish varnish-bugs at varnish-cache.org
Wed Aug 6 16:07:42 CEST 2014

#1566: escape sequence breaks regex
 Reporter:  RWOverdijk  |       Type:  defect
   Status:  new         |   Priority:  normal
Milestone:              |  Component:  build
  Version:  unknown     |   Severity:  normal
 Keywords:              |
 This replace (routine vcl_fetch) breaks varnish:
 set req.url = regsuball(req.url, "\??(p|pi)=.*?(&|$)", "");

 Here's the error:

 varnishification at varisification:/etc/varnish$ sudo service varnish restart
  * Stopping HTTP accelerator varnishd
  * Starting HTTP accelerator varnishd
 Message from C-compiler:
 ./vcl.3F4sQ4FV.c: In function ‘VGC_Init’:
 ./vcl.3F4sQ4FV.c:1264:28: error: trigraph ??( ignored, use -trigraphs to
 enable [-Werror=trigraphs]
   VRT_re_init(&VGC_re_3, "\\??(p|pi)=.*?(&|$)");
 ./vcl.3F4sQ4FV.c: At top level:
 ./vcl.3F4sQ4FV.c:1355:42: error: trigraph ??( ignored, use -trigraphs to
 enable [-Werror=trigraphs]
   "  set req.url = regsuball(req.url, \"\\??(p|pi)=.*?(&|$)\", \"\");\n"
 cc1: all warnings being treated as errors
 Running C-compiler failed, exit 1

 VCL compilation failed

 In my opinion this is a bug. It's a string, and the official language
 being communicated to users is VCL, not C. So, varnish should probably
 escape this escape sequence.

Ticket URL: <https://www.varnish-cache.org/trac/ticket/1566>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

More information about the varnish-bugs mailing list