From 3c516fc989b32a4ef764e595b5453646fa8521b1 Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Fri, 20 Mar 2020 10:04:34 +0100 Subject: [PATCH] BUG/MINOR: ssl: crtlist_dup_filters() must return NULL with fcount == 0 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ssl_sock.c b/src/ssl_sock.c index ea513b2f3..e5cee539c 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -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;