]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: ssl: Correctly add the 1 for the sentinel to the number of elements
authorTim Duesterhus <tim@bastelstu.be>
Thu, 19 Mar 2020 15:12:10 +0000 (16:12 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Fri, 20 Mar 2020 08:43:53 +0000 (09:43 +0100)
In `crtlist_dup_filters()` add the `1` to the number of elements instead of
the size of a single element.

This bug was introduced in commit 2954c478ebab019b814b97cbaec4653af7f03f34,
which is 2.2+. No backport needed.

src/ssl_sock.c

index 3ff81727702604773ad206b6d42c0a8b6f58ea1c..ea513b2f39c4553aabf586f58cd07d1563405725 100644 (file)
@@ -4656,7 +4656,7 @@ static char **crtlist_dup_filters(char **args, int fcount)
        char **dst;
        int i;
 
-       dst = calloc(fcount, sizeof(*dst) + 1);
+       dst = calloc(fcount + 1, sizeof(*dst));
        if (!dst)
                return NULL;