:: commit ddb985c39cfda5663199a2051ff19e90912c829e

mintsuki <mintsuki@protonmail.com> — 2022-10-05 12:07

parents: 6d6c8e084b

limine: Fix bug where NULL term was accessed. Fixes #227

diff --git a/common/protos/limine.c b/common/protos/limine.c
index 6b44253f..c9020234 100644
--- a/common/protos/limine.c
+++ b/common/protos/limine.c
@@ -755,9 +755,10 @@ FEAT_START
 FEAT_END
 
     // Clear terminal for kernels that will use the Limine terminal
-    term_write(term, "\e[2J\e[H", 7);
-
-    term->in_bootloader = false;
+    if (term != NULL) {
+        term_write(term, "\e[2J\e[H", 7);
+        term->in_bootloader = false;
+    }
 
     stivale_spinup(64, want_5lv, &pagemap, entry_point, 0,
                    reported_addr(stack), nx_available, true, (uintptr_t)local_gdt);
tab: 248 wrap: offon