diff options
author | Pascal Cuoq <cuoq@trust-in-soft.com> | 2015-10-19 22:24:23 +0200 |
---|---|---|
committer | Kurt Roeckx <kurt@roeckx.be> | 2015-11-20 22:29:53 +0100 |
commit | 9f6795e7d2d1e35668ad70ba0afc480062be4e2e (patch) | |
tree | fb50b054a816007e859328affb98d317b17ac5f0 /crypto/bn | |
parent | 1786086b05714c284b337d5211b299e09b9cfad9 (diff) |
BN_usub: Don't copy when r and a the same
Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Rich Salz <rsalz@akamai.com>
RT #4100, MR #1264
Diffstat (limited to 'crypto/bn')
-rw-r--r-- | crypto/bn/bn_add.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/bn/bn_add.c b/crypto/bn/bn_add.c index 0bfc3cc637..bbb0584245 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; |