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;