]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: ssl: crtlist_dup_filters() must return NULL with fcount == 0
authorWilliam Lallemand <wlallemand@haproxy.com>
Fri, 20 Mar 2020 09:04:34 +0000 (10:04 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Fri, 20 Mar 2020 09:10:25 +0000 (10:10 +0100)
crtlist_dup_filters() must return a NULL ptr if the fcount number is 0.

This bug was introduced by 2954c47 ("MEDIUM: ssl: allow crt-list caching").

src/ssl_sock.c

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