BUG/MEDIUM: checks: segfault with external checks in a backend section
authorCyril Bonté <cyril.bonte@free.fr>
Wed, 6 Aug 2014 23:55:38 +0000 (01:55 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 7 Aug 2014 05:23:51 +0000 (07:23 +0200)
commit99c5bf5ff4b07b1bc96e03591a6d5b2fbd816c3a
tree02eff37cbc621f0cb5dbf98adac6358b09d95a59
parent77010d8006619d8e8199c4adc23fd77d9102edd8
BUG/MEDIUM: checks: segfault with external checks in a backend section

The documentation indicates that external checks can be used in a backend
section, but the code requires a listener to provide information in the script
arguments.
External checks were initialized lately, during the first check, leaving some
variables uninitialized in such a scenario, which trigger the segfault when
accessed to collect errors information.

To prevent the segfault, currently we should initialize the external checks
earlier, during the process initialiation itself and quit if the error occurs.

This fix is specific to the 1.6 branch.
src/checks.c