commit | c02f148fa8c23f71ed830996cf29e81185e82488 | [log] [tgz] |
---|---|---|
author | David Benjamin <davidben@chromium.org> | Wed Mar 18 19:51:13 2015 -0400 |
committer | Adam Langley <agl@google.com> | Thu Mar 19 11:10:27 2015 +0000 |
tree | 7796423d82c20d6dd00b74557575a4ad95aa9345 | |
parent | 87b2a13a8609b1a035260cd3690658c8396eb451 [diff] |
Fix error handling in bn_exp In the event of an error |rr| could be NULL. Therefore don't assume you can use |rr| in the error handling code. (Imported from upstream's 8c5a7b33c6269c3bd6bc0df6b4c22e4fba03b485.) Change-Id: I0b392991ce8170dc418e93003af256d535d1e2e8 Reviewed-on: https://boringssl-review.googlesource.com/4005 Reviewed-by: Adam Langley <agl@google.com>
diff --git a/crypto/bn/exponentiation.c b/crypto/bn/exponentiation.c index 3a07704..57f319a 100644 --- a/crypto/bn/exponentiation.c +++ b/crypto/bn/exponentiation.c
@@ -172,12 +172,13 @@ } } } - ret = 1; -err: if (r != rr) { BN_copy(r, rr); } + ret = 1; + +err: BN_CTX_end(ctx); return ret; }