BUG/MINOR: ssl: fix a trash buffer leak in some error cases
authorWilliam Lallemand <wlallemand@haproxy.com>
Mon, 8 Jun 2020 07:40:37 +0000 (09:40 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Mon, 8 Jun 2020 08:18:20 +0000 (10:18 +0200)
commit436f0e5a5c9365917bd9d68c1fade83dd30825c1
treea87eec5926080c061a1dc121c319e7115e748b04
parent29e710624583d71e7eeae63a6ea7734006a1ea57
BUG/MINOR: ssl: fix a trash buffer leak in some error cases

Fix a trash buffer leak when we can't take the lock of the ckch, or when
"set ssl cert" is wrongly used.

The bug was mentionned in this thread:
https://www.mail-archive.com/haproxy@formilux.org/msg37539.html

The bug was introduced by commit bc6ca7c ("MINOR: ssl/cli: rework 'set
ssl cert' as 'set/commit'").

Must be backported in 2.1.

(cherry picked from commit e5ff4addb2300db60f5a4d1f99abd54b4a1a94f6)
[wla: function cli_parse_set_cert() was moved in 2.2 and is in
src/ssl_sock.c in 2.1]
Signed-off-by: William Lallemand <wlallemand@haproxy.org>
src/ssl_sock.c