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 e09451d88bba18c7d793a791dfc100e9813b8187..57e1cdac16626be3d588fc0939167dd93f91ff2a 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;