mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-15 07:51:04 +01:00
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.
This commit is contained in:
parent
7e0847045a
commit
e22bfd61b1
@ -7470,7 +7470,7 @@ int check_config_validity()
|
|||||||
free_email_alert(curproxy);
|
free_email_alert(curproxy);
|
||||||
}
|
}
|
||||||
if (!curproxy->email_alert.myhostname)
|
if (!curproxy->email_alert.myhostname)
|
||||||
curproxy->email_alert.myhostname = hostname;
|
curproxy->email_alert.myhostname = strdup(hostname);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (curproxy->check_command) {
|
if (curproxy->check_command) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user