BUG/MEDIUM: tcp-check: Do not dereference inexisting connection

This part was already fixed by commit ef91c939f3 ("BUG/MEDIUM: tcp-checks:
do not dereference inexisting conn_stream"). But there is still a way to
dereference an inexisting connection when tcpcheck_main() is called for a
check in failure (check->result == CHK_RES_FAILED) with no conn-stream (and
thus with no connection).

Before setting CO_FL_ERROR flag on the connection at the end of
tcpcheck_main(), we must validate the connection exists.

This patch should fix the issue #1337. It must be backported as far as
1.8. There is no upstream commit ID because this part was totally refactored
in upper version.
1 file changed