BUG/MINOR: hlua_fcn: potentially unsafe stktable_data_ptr usage
As reported by Coverity in GH #2253, stktable_data_ptr() usage in
hlua_stktable_dump() func is potentially unsafe because
stktable_data_ptr() may return NULL and the returned value is
dereferenced as-is without precautions.
In practise, this should not happen because some error checking was
already performed prior to calling stktable_data_ptr(). But since we're
using the safe stktable_data_ptr() function, all the error checking is
already done within the function, thus all we need to do is check ptr
against NULL instead to protect against NULL dereferences.
This should be backported in every stable versions.
(cherry picked from commit ee1891ccbe1d0e614985d30b83036567bcc3784e)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit a898241cf664d4c8964fd746f36e64efeaa211db)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 93d272ccaf4d4d8647a75848dc104ddc8825541a)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit d37194c9f0d6ed0f0ca3968db6993488f34eb1e2)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
1 file changed