projects
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a595e32
)
Add static check in BN_hex2bn
author
Kan
<chenxinpingc2306@163.com>
Thu, 16 Dec 2021 16:35:32 +0000
(
00:35
+0800)
committer
Pauli
<pauli@openssl.org>
Thu, 23 Dec 2021 01:52:53 +0000
(12:52 +1100)
Fixes #17298
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17299)
crypto/bn/bn_conv.c
patch
|
blob
|
history
diff --git
a/crypto/bn/bn_conv.c
b/crypto/bn/bn_conv.c
index 6757f3d0aae98c4c5f82a70a7b8963beae85ad6e..75054f5d6a6c7432773276b077dc498e65b9ed64 100644
(file)
--- a/
crypto/bn/bn_conv.c
+++ b/
crypto/bn/bn_conv.c
@@
-154,6
+154,10
@@
int BN_hex2bn(BIGNUM **bn, const char *a)
return 0;
} else {
ret = *bn;
+ if (BN_get_flags(ret, BN_FLG_STATIC_DATA)) {
+ ERR_raise(ERR_LIB_BN, ERR_R_PASSED_INVALID_ARGUMENT);
+ return 0;
+ }
BN_zero(ret);
}