mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 08:39:22 +00:00
Kernel: Fix panic when switching to out-of-bounds console
This was caused by an off-by-two error. Fixes #19034
This commit is contained in:
parent
cbdd44b6d2
commit
05bc98a410
Notes:
sideshowbarker
2024-07-18 05:37:06 +09:00
Author: https://github.com/hojelse 🔰
Commit: 05bc98a410
Pull-request: https://github.com/SerenityOS/serenity/pull/19544
Issue: https://github.com/SerenityOS/serenity/issues/19034
Reviewed-by: https://github.com/MacDue
Reviewed-by: https://github.com/gmta ✅
Reviewed-by: https://github.com/tcl3
1 changed files with 1 additions and 1 deletions
|
@ -253,7 +253,7 @@ void KeyboardDevice::handle_scan_code_input_event(ScanCodeEvent event)
|
||||||
Scheduler::dump_scheduler_state(m_modifiers == (Mod_Ctrl | Mod_Alt | Mod_Shift));
|
Scheduler::dump_scheduler_state(m_modifiers == (Mod_Ctrl | Mod_Alt | Mod_Shift));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((m_modifiers & Mod_Alt) != 0 && key >= Key_1 && key <= Key_1 + ConsoleManagement::s_max_virtual_consoles + 1) {
|
if ((m_modifiers & Mod_Alt) != 0 && key >= Key_1 && key < Key_1 + ConsoleManagement::s_max_virtual_consoles) {
|
||||||
// FIXME: Do something sanely here if we can't allocate a work queue?
|
// FIXME: Do something sanely here if we can't allocate a work queue?
|
||||||
MUST(g_io_work->try_queue([key]() {
|
MUST(g_io_work->try_queue([key]() {
|
||||||
ConsoleManagement::the().switch_to(key - Key_1);
|
ConsoleManagement::the().switch_to(key - Key_1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue