Cast time_t to uint64_t before converting to milliseconds in ct_policy.c
authorRob Percival <robpercival@google.com>
Wed, 14 Sep 2016 19:25:01 +0000 (20:25 +0100)
committerRich Salz <rsalz@openssl.org>
Tue, 15 Nov 2016 21:12:41 +0000 (16:12 -0500)
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1554)

crypto/ct/ct_policy.c

index adee331..0f27443 100644 (file)
@@ -33,7 +33,9 @@ CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new(void)
     }
 
     // time(NULL) shouldn't ever fail, so don't bother checking for -1.
-    ctx->epoch_time_in_ms = (time(NULL) + SCT_CLOCK_DRIFT_TOLERANCE) * 1000;
+    ctx->epoch_time_in_ms = (uint64_t)(time(NULL) + SCT_CLOCK_DRIFT_TOLERANCE) *
+            1000;
+
     return ctx;
 }