Some cleanups for crypto/bn
[openssl.git] / crypto / bn / bn_add.c
index a446686c7475bb1069de413a97402d7ad1f64417..0bfc3cc637b17181c387922f99a5252e9adfc203 100644 (file)
@@ -222,7 +222,8 @@ int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
                 break;
         }
     }
-    memcpy(rp, ap, sizeof(*rp) * dif);
+    if (dif)
+        memcpy(rp, ap, sizeof(*rp) * dif);
 
     r->top = max;
     r->neg = 0;