aboutsummaryrefslogtreecommitdiff
path: root/crypto/param_build_set.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/param_build_set.c')
-rw-r--r--crypto/param_build_set.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/param_build_set.c b/crypto/param_build_set.c
index 5de06cc7ed68..f205d101936a 100644
--- a/crypto/param_build_set.c
+++ b/crypto/param_build_set.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2020-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -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);
}