BUG/MINOR: http_ana: clarify connection pointer check on L7 retry
authorWilly Tarreau <w@1wt.eu>
Tue, 23 Jun 2020 03:58:20 +0000 (05:58 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 3 Jul 2020 17:03:55 +0000 (19:03 +0200)
commit148e7c41fcdc5bc4fde65a5a39a6f41d3c48f545
treead997bc6193ce3937debe3552379299f1e413064
parent125fbcad2a5a15d290bb95231ff1a881ae0f09fa
BUG/MINOR: http_ana: clarify connection pointer check on L7 retry

Coverity reports a possible null deref in issue #703. It seems this
cannot happen as in order to have a CF_READ_ERROR we'd need to have
attempted a recv() which implies a conn_stream, thus conn cannot be
NULL anymore. But at least one line tests for conn and the other one
not, which is confusing. So let's add a check for conn before
dereferencing it.

This needs to be backported to 2.1 and 2.0. Note that in 2.0 it's
in proto_htx.c.

(cherry picked from commit ee99aaf1f9bad06475aaf8c5dc3c0986a9899952)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/http_ana.c