:: commit 066969456238ed39359ec9271f33b1209dd672c4

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

parents: bdf9b21971

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