]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: stktable: stktable_data_ptr() cannot fail in table_process_entry()
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 28 Dec 2023 08:48:56 +0000 (09:48 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 2 Jan 2024 07:51:51 +0000 (08:51 +0100)
commit41b7193e3cff7d3d84c161caf1cbcab7dbfce299
tree1ad861bb5f840de7121817be762db9119d7fb3d7
parentb7274e69ef923612a1e992d7b53dc1a4f5b80e58
MINOR: stktable: stktable_data_ptr() cannot fail in table_process_entry()

In table_process_entry(), stktable_data_ptr() result is dereferenced
without checking if it's NULL first, which may happen when bad inputs
are provided to the function.

However, data_type and ts arguments were already checked prior to calling
the function, so we know for sure that stktable_data_ptr() will never
return NULL in this case.

However some static code analyzers such as Coverity are being confused
because they think that the result might possibly be NULL.
(See GH #2398)

To make it explicit that we always provide good inputs and expect valid
result, let's switch to the __stktable_data_ptr() unsafe function.
src/stick_table.c