projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Fix overflow check in BN_bn2dec()
[openssl.git]
/
crypto
/
bn
/
bn_print.c
diff --git
a/crypto/bn/bn_print.c
b/crypto/bn/bn_print.c
index f6030ff14cc6cb4cacad7b95229e565b7a95acd0..e5f641b99dd73f06a21a32d7041690db1899dc4b 100644
(file)
--- a/
crypto/bn/bn_print.c
+++ b/
crypto/bn/bn_print.c
@@
-92,14
+92,13
@@
char *BN_bn2dec(const BIGNUM *a)
if (BN_is_negative(t))
*p++ = '-';
- i = 0;
while (!BN_is_zero(t)) {
+ if (lp - bn_data >= bn_data_num)
+ goto err;
*lp = BN_div_word(t, BN_DEC_CONV);
if (*lp == (BN_ULONG)-1)
goto err;
lp++;
- if (lp - bn_data >= bn_data_num)
- goto err;
}
lp--;
/*