]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: peers: Wrong "server_name" decoding.
authorFrédéric Lécaille <flecaille@haproxy.com>
Wed, 5 Jun 2019 08:20:09 +0000 (10:20 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 5 Jun 2019 11:36:34 +0000 (13:36 +0200)
commit344e94816c961713e9a272fb425edae8f4c95656
treea001c4d02dc007785b1b60a252668eb6214e2c04
parent0bdeeaacbbd2341a49af1b1d193a8b714e66cb69
BUG/MINOR: peers: Wrong "server_name" decoding.

This patch fixes a bug which does not occur at this time because the "server_name"
stick-table data type is the last one (see STKTABLE_DT_SERVER_NAME). It was introduced
by this commit: "MINOR: peers: Make peers protocol support new "server_name" data type".

Indeed when receiving STD_T_DICT stick-table data type we first decode the length
of these data, then we decode the ID of this dictionary entry. To know if there
is remaining data to parse, we check if we have reached the end of the current data,
relying on <msg_end> variable. But <msg_end> is at the end of the entire message!

So this patch computes the correct end of the current STD_T_DICT before doing
anything else with it.

Nothing to backport.
src/peers.c