[openssl] master update
tomas at openssl.org
tomas at openssl.org
Thu Jul 8 08:35:09 UTC 2021
The branch master has been updated
via daf4b2437f38bd104400517cf8ff2c8121813b1a (commit)
from 0588778f5ef5c5840e00879a1f62775e4c7a2f17 (commit)
- Log -----------------------------------------------------------------
commit daf4b2437f38bd104400517cf8ff2c8121813b1a
Author: Juergen Christ <jchrist at linux.ibm.com>
Date: Mon Jul 5 09:48:53 2021 +0200
Fix compile warning with GCC 11.
When configured with strict warnings, GCC 11 complains about a possible
stringop-translation:
Config:
/usr/bin/perl ./Configure enable-asan enable-ubsan enable-zlib-dynamic \
enable-unit-test enable-md2 enable-rc5 enable-buildtest-c++ \
enable-weak-ssl-ciphers enable-ssl3 enable-ssl3-method enable-fips -w \
--strict-warnings
Warning:
crypto/evp/ctrl_params_translate.c: In function 'fix_rsa_pss_saltlen':
crypto/evp/ctrl_params_translate.c:1356:13: error: 'strncpy' specified bound 50 equals destination size [-Werror=stringop-truncation]
1356 | strncpy(ctx->name_buf, str_value_map[i].ptr, sizeof(ctx->name_buf));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fix by copying one byte less than the buffer size. We anyway overwrite the
last byte.
Signed-off-by: Juergen Christ <jchrist at linux.ibm.com>
Reviewed-by: Paul Dale <pauli at openssl.org>
Reviewed-by: Tomas Mraz <tomas at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15993)
-----------------------------------------------------------------------
Summary of changes:
crypto/evp/ctrl_params_translate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/crypto/evp/ctrl_params_translate.c b/crypto/evp/ctrl_params_translate.c
index c532e57f8f..4ea17380af 100644
--- a/crypto/evp/ctrl_params_translate.c
+++ b/crypto/evp/ctrl_params_translate.c
@@ -1353,8 +1353,8 @@ static int fix_rsa_pss_saltlen(enum state state,
if (i == OSSL_NELEM(str_value_map)) {
BIO_snprintf(ctx->name_buf, sizeof(ctx->name_buf), "%d", ctx->p1);
} else {
- strncpy(ctx->name_buf, str_value_map[i].ptr, sizeof(ctx->name_buf));
/* This won't truncate but it will quiet static analysers */
+ strncpy(ctx->name_buf, str_value_map[i].ptr, sizeof(ctx->name_buf) - 1);
ctx->name_buf[sizeof(ctx->name_buf) - 1] = '\0';
}
ctx->p2 = ctx->name_buf;
More information about the openssl-commits
mailing list