bn/bn_add.c: fix dead code elimination that went bad.
authorAndy Polyakov <appro@openssl.org>
Mon, 9 Feb 2015 14:54:58 +0000 (15:54 +0100)
committerAndy Polyakov <appro@openssl.org>
Mon, 9 Feb 2015 14:54:58 +0000 (15:54 +0100)
Reviewed-by: Matt Caswell <matt@openssl.org>
crypto/bn/bn_add.c

index e09451d..57e1cda 100644 (file)
@@ -222,7 +222,7 @@ int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
                 break;
         }
     }
-    memcpy(rp, ap, sizeof(*rp) * (max - i));
+    memcpy(rp, ap, sizeof(*rp) * dif);
 
     r->top = max;
     r->neg = 0;