diff options
author | Pauli <pauli@openssl.org> | 2022-01-10 11:33:06 +1100 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2022-01-12 20:10:21 +1100 |
commit | 3ee3a2bd1e5763b0df5c0a2cba3b06edc26f5276 (patch) | |
tree | 23a25dfa8bd240709349ecf61ca0182a73dd8e5d /crypto | |
parent | 3831351da50b7ce07edba88056394a7a33c5e5d5 (diff) |
param build set: add errors to failure returns
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17440)
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); } |