From 2bc8c3db5c130ff37fa5711f4e8ca6fb3a533407 Mon Sep 17 00:00:00 2001
From: stoffu <stoffu@protonmail.ch>
Date: Thu, 8 Feb 2018 16:04:50 +0900
Subject: [PATCH] epee get_ns_count: cast to uint64_t before multiplying 10^9
 to avoid overflow

---
 contrib/epee/include/misc_os_dependent.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/epee/include/misc_os_dependent.h b/contrib/epee/include/misc_os_dependent.h
index 99690b301..ffe575501 100644
--- a/contrib/epee/include/misc_os_dependent.h
+++ b/contrib/epee/include/misc_os_dependent.h
@@ -75,13 +75,13 @@ namespace misc_utils
                 clock_get_time(cclock, &mts);
                 mach_port_deallocate(mach_task_self(), cclock);
 
-                return (mts.tv_sec * 1000000000) + (mts.tv_nsec);
+                return ((uint64_t)mts.tv_sec * 1000000000) + (mts.tv_nsec);
 #else
                 struct timespec ts;
                 if(clock_gettime(CLOCK_MONOTONIC, &ts) != 0) {
                         return 0;
                 }
-                return (ts.tv_sec * 1000000000) + (ts.tv_nsec);
+                return ((uint64_t)ts.tv_sec * 1000000000) + (ts.tv_nsec);
 #endif
         }