From: William Lallemand Date: Thu, 6 Nov 2025 11:12:18 +0000 (+0100) Subject: BUG/MINOR: acme: fix initialization issue in acme_gen_tmp_x509() X-Git-Tag: v3.3-dev12~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22f92804d6b831cd67df74631bd1fb343a03ce4d;p=thirdparty%2Fhaproxy.git BUG/MINOR: acme: fix initialization issue in acme_gen_tmp_x509() src/acme.c: In function ‘acme_gen_tmp_x509’: src/acme.c:2685:15: error: ‘digest’ may be used uninitialized [-Werror=maybe-uninitialized] 2685 | if (!(X509_sign(newcrt, pkey, digest))) | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/acme.c:2628:23: note: ‘digest’ was declared here 2628 | const EVP_MD *digest; | ^~~~~~ --- diff --git a/src/acme.c b/src/acme.c index 96a0cca42..33fec5030 100644 --- a/src/acme.c +++ b/src/acme.c @@ -2625,7 +2625,7 @@ X509 *acme_gen_tmp_x509() { X509 *newcrt = NULL; X509_NAME *name; - const EVP_MD *digest; + const EVP_MD *digest = NULL; CONF *ctmp = NULL; int key_type; EVP_PKEY *pkey = tmp_pkey; @@ -2681,6 +2681,8 @@ X509 *acme_gen_tmp_x509() digest = EVP_sha256(); else if (key_type == EVP_PKEY_EC) digest = EVP_sha256(); + else + goto mkcert_error; if (!(X509_sign(newcrt, pkey, digest))) goto mkcert_error;