summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAhmad Fatoum <ahmad@a3f.at>2020-02-03 09:27:58 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2020-02-10 09:42:43 +0100
commitde0c31a9293adb7518b3b86f12c53c41f8771a28 (patch)
treeb2ec5c944ec14a7273175fb5d1c554f5356b967e /arch
parent359fc72149bc30f471405e5495e8aa8d69d728c6 (diff)
downloadbarebox-de0c31a9293adb7518b3b86f12c53c41f8771a28.tar.gz
barebox-de0c31a9293adb7518b3b86f12c53c41f8771a28.tar.xz
sandbox: fix signed integer overflow
On a 32-bit host system, UBSan reports: =============================================================== UBSAN: Undefined behaviour in ./arch/sandbox/os/common.c:115:32 signed integer overflow: 83598 * 1000000000 cannot be represented in type 'long int' =============================================================== Fix this. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/sandbox/os/common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/sandbox/os/common.c b/arch/sandbox/os/common.c
index 3ad12b4a30..3f9cc70770 100644
--- a/arch/sandbox/os/common.c
+++ b/arch/sandbox/os/common.c
@@ -112,7 +112,7 @@ uint64_t linux_get_time(void)
clock_gettime(CLOCK_MONOTONIC, &ts);
- now = ts.tv_sec * 1000 * 1000 * 1000 + ts.tv_nsec;
+ now = ts.tv_sec * 1000ULL * 1000 * 1000 + ts.tv_nsec;
return now;
}