Commit 8c5a7b33 authored by Matt Caswell's avatar Matt Caswell
Browse files

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.

Reviewed-by: default avatarAndy Polyakov <appro@openssl.org>
parent 6b937f8b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -185,10 +185,10 @@ int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
                goto err;
        }
    }
    ret = 1;
 err:
    if (r != rr)
        BN_copy(r, rr);
    ret = 1;
 err:
    BN_CTX_end(ctx);
    bn_check_top(r);
    return (ret);