]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: ssl: init tmp chunk correctly in ssl_sock_load_sctl_from_file()
authorWilliam Lallemand <wlallemand@haproxy.org>
Wed, 27 Jan 2021 13:58:51 +0000 (14:58 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Wed, 27 Jan 2021 13:58:51 +0000 (14:58 +0100)
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

src/ssl_ckch.c

index 96eec9aabe0be923eea437f7f8aa20f2cd620f54..62e7b4475b733c978391823966d43db75d79abf8 100644 (file)
@@ -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);