RT3993: Fix error found by VS2008
authorDavid Woodhouse <David.Woodhouse@intel.com>
Wed, 9 Sep 2015 03:24:36 +0000 (23:24 -0400)
committerRich Salz <rsalz@openssl.org>
Wed, 9 Sep 2015 03:32:53 +0000 (23:32 -0400)
Cast and then negate, don't negate an unsigned.

Signed-off-by: Rich Salz <rsalz@akamai.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
crypto/asn1/a_int.c

index 0d020e0..5d5e7f6 100644 (file)
@@ -338,7 +338,7 @@ static int asn1_get_int64(int64_t *pr, const unsigned char *b, size_t blen,
             ASN1err(ASN1_F_ASN1_GET_INT64, ASN1_R_TOO_SMALL);
             return 0;
         }
-        *pr = (int64_t)-r;
+        *pr = -(int64_t)r;
     } else {
         if (r > INT64_MAX) {
             ASN1err(ASN1_F_ASN1_GET_INT64, ASN1_R_TOO_LARGE);