From: William Lallemand Date: Wed, 27 Jan 2021 13:58:51 +0000 (+0100) Subject: BUG/MINOR: ssl: init tmp chunk correctly in ssl_sock_load_sctl_from_file() X-Git-Tag: v2.3.5~35 X-Git-Url: http://git.haproxy.org/?a=commitdiff_plain;h=7cdbb5643de32c97f9d7693f140b89f4a4cb9493;p=haproxy-2.3.git BUG/MINOR: ssl: init tmp chunk correctly in ssl_sock_load_sctl_from_file() Use chunk_inistr() for a chunk initialisation in ssl_sock_load_sctl_from_file() instead of a manual initialisation which was not initialising head. Fix issue #1073. Must be backported as far as 2.2 (cherry picked from commit 8d67394f6915c6d2db40bc1e9593fd392827da8d) Signed-off-by: Willy Tarreau --- diff --git a/src/ssl_ckch.c b/src/ssl_ckch.c index 4a85a5d..1d7f409 100644 --- a/src/ssl_ckch.c +++ b/src/ssl_ckch.c @@ -101,9 +101,7 @@ int ssl_sock_load_sctl_from_file(const char *sctl_path, char *buf, struct cert_k struct buffer *sctl; if (buf) { - tmp.area = buf; - tmp.data = strlen(buf); - tmp.size = tmp.data + 1; + chunk_initstr(&tmp, buf); src = &tmp; } else { fd = open(sctl_path, O_RDONLY);