]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: ssl/cli: fix yielding in show_cafile_detail
authorWilliam Lallemand <wlallemand@haproxy.org>
Tue, 26 Apr 2022 16:17:15 +0000 (18:17 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Tue, 26 Apr 2022 17:35:43 +0000 (19:35 +0200)
commit03a32e5dd2fa103fa259db343d97bd093544ef25
treec908cd286ebc48dc767e9de203631242aee47bbb
parentf1344b3cee9c190f0cf4081b72e0544c47f3eb11
BUG/MEDIUM: ssl/cli: fix yielding in show_cafile_detail

HAProxy crashes when "show ssl ca-file" is being called on a ca-file
which contains a lot of certificates. (127 in our test with
/etc/ssl/certs/ca-certificates.crt).

The root cause is the fonction does not yield when there is no available
space when writing the details, and we could write a lot.

To fix the issue, we try to put the data with ci_putchk() after every
show_cert_detail() and we yield if the ci_putchk() fails.

This patch also cleans up a little bit the code:

- the end label is now a real end with a return 1;
- i0 is used instead of (long)p1
- the ID is stored upon yield
src/ssl_ckch.c