From 9ee6da65d8061ccb7e1cbee19d9bda1a15a25b3d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 25 Oct 2023 09:26:23 +0200 Subject: [PATCH] openssl: fix infof() to avoid compiler warning for %s with null MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit vtls/openssl.c: In function ‘ossl_connect_step2’: ../lib/curl_trc.h:120:10: error: ‘%s’ directive argument is null [-Werror=format-overflow=] 120 | Curl_infof(data, __VA_ARGS__); } while(0) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vtls/openssl.c:4008:5: note: in expansion of macro ‘infof’ 4008 | infof(data, "SSL connection using %s / %s / %s / %s", | ^~~~~ vtls/openssl.c:4008:49: note: format string is defined here 4008 | infof(data, "SSL connection using %s / %s / %s / %s", | ^~ Follow-up to b6e6d4ff8f253c8b8055bab Closes #12196 --- lib/vtls/openssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 9b36f33762..8dfad38faf 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -4008,7 +4008,7 @@ static CURLcode ossl_connect_step2(struct Curl_cfilter *cf, infof(data, "SSL connection using %s / %s / %s / %s", SSL_get_version(backend->handle), SSL_get_cipher(backend->handle), - negotiated_group_name == NULL ? NULL : negotiated_group_name, + negotiated_group_name? negotiated_group_name : "[blank]", OBJ_nid2sn(psigtype_nid)); #ifdef HAS_ALPN -- 2.47.3