]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: stktable: avoid ambiguous stktable_data_ptr() usage in cli_io_handler_table()
authorAurelien DARRAGON <adarragon@haproxy.com>
Mon, 3 Jun 2024 13:24:27 +0000 (15:24 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Mon, 3 Jun 2024 14:59:54 +0000 (16:59 +0200)
commit8860c22c00f1545c12e45be0628c12a735ceb505
tree9a7bfd03c775740b88a3e69da32710f86d29e594
parentdc8a2c7f43aca6cb02246da67fe0ea93cc3f14b0
MINOR: stktable: avoid ambiguous stktable_data_ptr() usage in cli_io_handler_table()

As reported by @Bbulatov in GH #2586, stktable_data_ptr() return value is
used without checking it isn't NULL first, which may happen if the given
type is invalid or not stored in the table.

However, since date_type is set by table_prepare_data_request() right
before cli_io_handler_table() is invoked, date_type is not expected to
be invalid: table_prepare_data_request() normally checked that the type
is stored inside the table. Thus stktable_data_ptr() should not be failing
at this point, so we add a BUG_ON() to indicate that.
src/stick_table.c