Convert RSA blinding to new multi-threading API
[openssl.git] / crypto / bn / bn_add.c
index a446686c7475bb1069de413a97402d7ad1f64417..3e7d86b2dd57acdaaf3af2510af3f26de66cf637 100644 (file)
@@ -1,4 +1,3 @@
-/* crypto/bn/bn_add.c */
 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
@@ -222,7 +221,8 @@ int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
                 break;
         }
     }
-    memcpy(rp, ap, sizeof(*rp) * dif);
+    if (dif && ap != rp)
+        memcpy(rp, ap, sizeof(*rp) * dif);
 
     r->top = max;
     r->neg = 0;