From: Gerd Hoffmann Date: Mon, 15 Jul 2024 15:22:01 +0000 (+0200) Subject: fix vs2019 warning X-Git-Tag: openssl-3.4.0-alpha1~319 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d7af3f7aa7c0d311c472e65b00928771192e6a06;p=thirdparty%2Fopenssl.git fix vs2019 warning windows vs2019 throws warnings when compiling openssl for edk2: ERROR - Compiler #2220 from [2024-07-15 13:43:34] [build-stdout] d:\a\edk2\edk2\CryptoPkg\Library\OpensslLib\openssl\ssl\statem\statem_clnt.c(1895) : the following warning is treated as an error WARNING - Compiler #4701 from [2024-07-15 13:43:34] [build-stdout] d:\a\edk2\edk2\CryptoPkg\Library\OpensslLib\openssl\ssl\statem\statem_clnt.c(1895) : potentially uninitialized local variable 'peer_rpk' used WARNING - Compiler #4703 from [2024-07-15 13:43:34] [build-stdout] d:\a\edk2\edk2\CryptoPkg\Library\OpensslLib\openssl\ssl\statem\statem_clnt.c(1895) : potentially uninitialized local pointer variable 'peer_rpk' used Explicitly initialize the peer_rpk variable to make the compiler happy. Yes, it's a false positive, but you have to check the tls_process_rpk() body in another source file to see that, which apparently is beyond the compiler's capabilities. Signed-off-by: Gerd Hoffmann Reviewed-by: Neil Horman Reviewed-by: Tom Cosgrove Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/24895) --- diff --git a/ssl/statem/statem_clnt.c b/ssl/statem/statem_clnt.c index 162442ea2de..b08fe2ac414 100644 --- a/ssl/statem/statem_clnt.c +++ b/ssl/statem/statem_clnt.c @@ -1886,7 +1886,7 @@ static MSG_PROCESS_RETURN tls_process_as_hello_retry_request(SSL_CONNECTION *s, MSG_PROCESS_RETURN tls_process_server_rpk(SSL_CONNECTION *sc, PACKET *pkt) { - EVP_PKEY *peer_rpk; + EVP_PKEY *peer_rpk = NULL; if (!tls_process_rpk(sc, pkt, &peer_rpk)) { /* SSLfatal() already called */