mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 22:01:31 +02:00
BUG/MINOR: listener: add an error check for unallocatable trash
Coverity noticed in issue #1416 that a missing allocation error was introduced in tcp_bind_listener() with the rework of error messages by commit ed1748553 ("MINOR: proto_tcp: use chunk_appendf() to ouput socket setup errors"). In practice nobody will ever face it but better address it anyway. No backport is needed.
This commit is contained in:
parent
a146289d4f
commit
7c4c830d04
@ -589,6 +589,12 @@ int tcp_bind_listener(struct listener *listener, char *errmsg, int errlen)
|
|||||||
|
|
||||||
err = ERR_NONE;
|
err = ERR_NONE;
|
||||||
|
|
||||||
|
if (!msg) {
|
||||||
|
if (errlen)
|
||||||
|
snprintf(errmsg, errlen, "out of memory");
|
||||||
|
return ERR_ALERT | ERR_FATAL;
|
||||||
|
}
|
||||||
|
|
||||||
/* ensure we never return garbage */
|
/* ensure we never return garbage */
|
||||||
if (errlen)
|
if (errlen)
|
||||||
*errmsg = 0;
|
*errmsg = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user