From: Daniel Stenberg Date: Wed, 25 Oct 2023 07:26:23 +0000 (+0200) Subject: openssl: fix infof() to avoid compiler warning for %s with null X-Git-Tag: curl-8_5_0~194 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9ee6da65d8061ccb7e1cbee19d9bda1a15a25b3d;p=thirdparty%2Fcurl.git openssl: fix infof() to avoid compiler warning for %s with null 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 --- 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