From edfb1ace4a1ec9d749169069041efd5bf39d96c8 Mon Sep 17 00:00:00 2001 From: ZmnSCPxj Date: Fri, 24 May 2019 00:32:51 +0000 Subject: [PATCH] wallet/db.c: Be resilient against 32-bit time_t. Fixes: #2621 --- wallet/db.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wallet/db.c b/wallet/db.c index c683e1c8e..a6fe7d2e9 100644 --- a/wallet/db.c +++ b/wallet/db.c @@ -1165,7 +1165,7 @@ void migrate_pr2342_feerate_per_channel(struct lightningd *ld, struct db *db) void sqlite3_bind_timeabs(sqlite3_stmt *stmt, int col, struct timeabs t) { - u64 timestamp = t.ts.tv_nsec + (t.ts.tv_sec * NSEC_IN_SEC); + u64 timestamp = t.ts.tv_nsec + (((u64) t.ts.tv_sec) * ((u64) NSEC_IN_SEC)); sqlite3_bind_int64(stmt, col, timestamp); }