BUG/MINOR: http rule: http capture 'id' rule points to a non existing id
authorBaptiste Assmann <bedis9@gmail.com>
Tue, 3 Nov 2015 22:31:35 +0000 (23:31 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 4 Nov 2015 07:47:55 +0000 (08:47 +0100)
commite9544935e86278dfa3d49fb4b97b860774730625
treeed4b58c3c15438bf2e88c2440e1f3dee716c80d4
parent55f9ff11b507eccfebb8f212962e675551d61c7b
BUG/MINOR: http rule: http capture 'id' rule points to a non existing id

It is possible to create a http capture rule which points to a capture slot
id which does not exist.

Current patch prevent this when parsing configuration and prevent running
configuration which contains such rules.

This configuration is now invalid:

  frontend f
   bind :8080
   http-request capture req.hdr(User-Agent) id 0
   default_backend b

this one as well:

  frontend f
   bind :8080
   declare capture request len 32 # implicit id is 0 here
   http-request capture req.hdr(User-Agent) id 1
   default_backend b

It applies of course to both http-request and http-response rules.
doc/configuration.txt
include/proto/proto_http.h
src/cfgparse.c