From 37fded37e3de77bff857371cb42963ac0f6886ef Mon Sep 17 00:00:00 2001 From: "Bernhard M. Wiedemann" Date: Fri, 29 May 2026 14:22:56 +0200 Subject: [PATCH] Avoid int overflow after year 2038 So it can work until year 2106. See https://en.wikipedia.org/wiki/Year_2038_problem This patch was done while reviewing potential year-2038 issues in openSUSE. Signed-off-by: Bernhard M. Wiedemann --- util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util.c b/util.c index cdc55435..c9f5ab8f 100644 --- a/util.c +++ b/util.c @@ -634,7 +634,7 @@ int check_ext2(int fd, char *name) if (sb[56] != 0x53 || sb[57] != 0xef) return 0; - mtime = sb[44]|(sb[45]|(sb[46]|sb[47]<<8)<<8)<<8; + mtime = sb[44]|(sb[45]|(sb[46]|(unsigned int)sb[47]<<8)<<8)<<8; bsize = sb[24]|(sb[25]|(sb[26]|sb[27]<<8)<<8)<<8; size = sb[4]|(sb[5]|(sb[6]|sb[7]<<8)<<8)<<8; size <<= bsize;