diff options
author | Pauli <pauli@openssl.org> | 2022-01-10 11:33:06 +1100 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2022-11-09 15:31:16 +0100 |
commit | 584e447377925fbe3c253076ac170483208d9222 (patch) | |
tree | d49ab2d42b29587e376a96c24b9a60ab86c1f3b0 /crypto | |
parent | b08f61e7c4db8bfcb94c4ea546bc3dacfd96c587 (diff) | |
download | openssl-new-584e447377925fbe3c253076ac170483208d9222.tar.gz |
param build set: add errors to failure returns
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17440)
(cherry picked from commit 3ee3a2bd1e5763b0df5c0a2cba3b06edc26f5276)
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/param_build_set.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/param_build_set.c b/crypto/param_build_set.c index 8b570ded96..75400eea9e 100644 --- a/crypto/param_build_set.c +++ b/crypto/param_build_set.c @@ -73,8 +73,10 @@ int ossl_param_build_set_bn_pad(OSSL_PARAM_BLD *bld, OSSL_PARAM *p, return OSSL_PARAM_BLD_push_BN_pad(bld, key, bn, sz); p = OSSL_PARAM_locate(p, key); if (p != NULL) { - if (sz > p->data_size) + if (sz > p->data_size) { + ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_SMALL_BUFFER); return 0; + } p->data_size = sz; return OSSL_PARAM_set_BN(p, bn); } |