]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: stick-table: allocate the table key of size buffer size
authorWilly Tarreau <w@1wt.eu>
Mon, 29 Oct 2012 20:56:59 +0000 (21:56 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 29 Oct 2012 20:56:59 +0000 (21:56 +0100)
commit07115412d3b7bb4c55e4fa5a88fdcf5450cb7a2f
tree611e6dc673fcae65f4a6e3f9c59ba584d8a32cdb
parent7e2c647ee7d0a5c57fb56c38d41eb0c556be154b
MEDIUM: stick-table: allocate the table key of size buffer size

Keys are copied from samples to stick_table_key. If a key is larger
than the stick_table_key, we have an overflow. In pratice it does not
happen because it requires :
   1) a configuration with tune.bufsize larger than BUFSIZE (common)
   2) a stick-table configured with keys strictly larger than buffers
   3) extraction of data larger than BUFSIZE (eg: using payload())

Points 2 and 3 don't make any sense for a real world configuration. That
said the issue needs be fixed. The solution consists in allocating it the
same size as the global buffer size, just like the samples. This fixes the
issue.
include/proto/proto_tcp.h
include/proto/stick_table.h
include/types/stick_table.h
src/dumpstats.c
src/haproxy.c
src/stick_table.c