]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: checks: email-alert causes a segfault when an unknown mailers section...
authorCyril Bonté <cyril.bonte@free.fr>
Fri, 4 Dec 2015 02:07:07 +0000 (03:07 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 4 Dec 2015 05:09:30 +0000 (06:09 +0100)
commite22bfd61b132601b3200121111c27d615f1122bf
treef12d5287c19b8dd62d61d9484a352a5064e9b1c1
parent7e0847045a236e67f6a5bf83ae54971409892115
BUG/MINOR: checks: email-alert causes a segfault when an unknown mailers section is configured

A segfault can occur during at the initialization phase, when an unknown
"mailers" name is configured. This happens when "email-alert myhostname" is not
set, where a direct pointer to an array is used instead of copying the string,
causing the segfault when haproxy tries to free the memory.

This is a minor issue because the configuration is invalid and a fatal error
will remain, but it should be fixed to prevent reload issues.

Example of minimal configuration to reproduce the bug :
    backend example
        email-alert mailers NOT_FOUND
        email-alert from foo@localhost
        email-alert to bar@localhost

This fix must be backported to 1.6.
src/cfgparse.c