:: commit 43ba7d66d289b13090589f2a3eac67f2747974e8

Mintsuki <mintsuki@protonmail.com> — 2026-02-08 06:35

parents: 6dc0fa3026

lib/getchar: Fix signed integer overflow in timer computation

diff --git a/common/lib/getchar.c b/common/lib/getchar.c
index 74bf690a..8f568a68 100644
--- a/common/lib/getchar.c
+++ b/common/lib/getchar.c
@@ -292,7 +292,7 @@ int pit_sleep_and_quit_on_keypress(int seconds) {
 
     gBS->CreateEvent(EVT_TIMER, TPL_CALLBACK, NULL, NULL, &events[1]);
 
-    gBS->SetTimer(events[1], TimerRelative, 10000000 * seconds);
+    gBS->SetTimer(events[1], TimerRelative, (uint64_t)10000000 * seconds);
 
 again:
     memset(&kd, 0, sizeof(EFI_KEY_DATA));
tab: 248 wrap: offon