From: Emmanuel Hocdet Date: Thu, 24 Oct 2019 16:28:33 +0000 (+0200) Subject: BUG/MINOR: ssl: ckch->chain must be initialized X-Git-Tag: v2.1-dev4~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed17f47c71af521a28e296f04bfcbc936e4cfba3;p=thirdparty%2Fhaproxy.git BUG/MINOR: ssl: ckch->chain must be initialized It's a regression from 96a9c973 "MINOR: ssl: split ssl_sock_load_crt_file_into_ckch()". --- diff --git a/src/ssl_sock.c b/src/ssl_sock.c index 207b4518d6..c6878e4608 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -3196,6 +3196,11 @@ static int ssl_sock_load_pem_into_ckch(const char *path, char *buf, struct cert_ goto end; } + /* no chain */ + if (ckch->chain == NULL) { + ckch->chain = sk_X509_new_null(); + } + ret = ERR_get_error(); if (ret && (ERR_GET_LIB(ret) != ERR_LIB_PEM && ERR_GET_REASON(ret) != PEM_R_NO_START_LINE)) { memprintf(err, "%sunable to load certificate chain from file '%s'.\n",