diff --git a/crypto/bn/bn_add.c b/crypto/bn/bn_add.c index 0bfc3cc637b17181c387922f99a5252e9adfc203..bbb05842452e6558fead3bc84a1cb9cd1482ebbb 100644 --- a/crypto/bn/bn_add.c +++ b/crypto/bn/bn_add.c @@ -222,7 +222,7 @@ int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) break; } } - if (dif) + if (dif && ap != rp) memcpy(rp, ap, sizeof(*rp) * dif); r->top = max;