Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/crypto/bn
diff options
context:
space:
mode:
authorBrian Smith <brian@briansmith.org>2015-08-06 18:14:55 +0300
committerAdam Langley <agl@google.com>2015-08-07 03:52:58 +0300
commit62138c5d5a2450c3a9da5b741048c6bb56745aed (patch)
treefbcdd1986836a610f0a640a06b1f9e06e8f0d49c /crypto/bn
parentf4bbc2a3607d543693e5dcfb7eeafb4625e955b6 (diff)
Check the return value of |BN_sub| in bn_test.cc.
Coverity complains about this. Change-Id: I5140fd82bdbe7c2e3b36a8bc9006770a431741ea Reviewed-on: https://boringssl-review.googlesource.com/5619 Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/bn')
-rw-r--r--crypto/bn/bn_test.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/bn/bn_test.cc b/crypto/bn/bn_test.cc
index eaceb270..f9f83d32 100644
--- a/crypto/bn/bn_test.cc
+++ b/crypto/bn/bn_test.cc
@@ -1188,8 +1188,9 @@ static bool test_exp(FILE *fp, BN_CTX *ctx) {
if (!BN_one(e.get())) {
return false;
}
- for (; !BN_is_zero(b.get()); BN_sub(b.get(), b.get(), BN_value_one())) {
- if (!BN_mul(e.get(), e.get(), a.get(), ctx)) {
+ while (!BN_is_zero(b.get())) {
+ if (!BN_mul(e.get(), e.get(), a.get(), ctx) ||
+ !BN_sub(b.get(), b.get(), BN_value_one())) {
return false;
}
}