evp: fix coverity 1473380: copy into fixed size buffer

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14614)
This commit is contained in:
Pauli 2021-03-19 08:22:43 +10:00
parent c38048e793
commit abded2ced4

View File

@ -1344,7 +1344,7 @@ static int fix_rsa_pss_saltlen(enum state state,
break;
}
if (i == OSSL_NELEM(str_value_map)) {
BIO_snprintf(ctx->name_buf, 5, "%d", ctx->p1);
BIO_snprintf(ctx->name_buf, sizeof(ctx->name_buf), "%d", ctx->p1);
} else {
strcpy(ctx->name_buf, str_value_map[i].ptr);
}