aboutsummaryrefslogtreecommitdiff
path: root/src/openvpn/ssl_openssl.c
diff options
context:
space:
mode:
authorArne Schwabe2024-03-26 11:41:01 +0100
committerGert Doering2024-03-26 12:03:00 +0100
commit6889d9e2f1458272ded4c035df40378ace3d7395 (patch)
treed5e797a4e827c8dd1fffae73934802a7fa07d6ff /src/openvpn/ssl_openssl.c
parente8c629fe64c67ea0a8454753be99db44df7ce53e (diff)
downloadopenvpn-6889d9e2f1458272ded4c035df40378ace3d7395.zip
openvpn-6889d9e2f1458272ded4c035df40378ace3d7395.tar.gz
Fix snprintf/swnprintf related compiler warnings
When openvpn_snprintf is replaced by snprintf the GCC/MSVC compiler will perform additional checks that the result is not truncated. This warning can be avoid by either explicitly checking the return value of snprintf (proxy) or ensuring that it is never truncated(tls crypt) Change-Id: If23988a05dd53a519c5e57f2aa3b2d10bd29df1d Signed-off-by: Arne Schwabe <arne@rfc2549.org> Acked-by: Frank Lichtenheld <frank@lichtenheld.com> Message-Id: <20240326104101.531291-1-frank@lichtenheld.com> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg28475.html Signed-off-by: Gert Doering <gert@greenie.muc.de>
Diffstat (limited to 'src/openvpn/ssl_openssl.c')
-rw-r--r--src/openvpn/ssl_openssl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/openvpn/ssl_openssl.c b/src/openvpn/ssl_openssl.c
index 4383e98..6f29c3d 100644
--- a/src/openvpn/ssl_openssl.c
+++ b/src/openvpn/ssl_openssl.c
@@ -2069,7 +2069,7 @@ print_pkey_details(EVP_PKEY *pkey, char *buf, size_t buflen)
#endif
#ifndef OPENSSL_NO_EC
- char groupname[256];
+ char groupname[64];
if (is_ec)
{
size_t len;
@@ -2130,7 +2130,7 @@ static void
print_cert_details(X509 *cert, char *buf, size_t buflen)
{
EVP_PKEY *pkey = X509_get_pubkey(cert);
- char pkeybuf[128] = { 0 };
+ char pkeybuf[64] = { 0 };
print_pkey_details(pkey, pkeybuf, sizeof(pkeybuf));
char sig[128] = { 0 };