mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-19 18:28:33 +00:00
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.
This commit is contained in:
parent
dc8a2c7f43
commit
8860c22c00
@ -5597,6 +5597,10 @@ static int cli_io_handler_table(struct appctx *appctx)
|
||||
ptr = stktable_data_ptr(ctx->t,
|
||||
ctx->entry,
|
||||
dt);
|
||||
/* table_prepare_data_request() normally ensures the
|
||||
* type is both valid and stored
|
||||
*/
|
||||
BUG_ON(!ptr);
|
||||
|
||||
data = 0;
|
||||
switch (stktable_data_types[dt].std_type) {
|
||||
|
Loading…
Reference in New Issue
Block a user