diff options
author | Andreas Kling <kling@serenityos.org> | 2020-03-04 19:26:13 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-03-04 21:04:06 +0100 |
commit | dfa69b82b4233494e65af53bdd620ab33e0c043a (patch) | |
tree | 5874e711d16f4033c84be83b32c66e28829fb83b /Libraries/LibBareMetal | |
parent | 783c99516a92faced0d2d5b030ef862d64b19c48 (diff) | |
download | serenity-dfa69b82b4233494e65af53bdd620ab33e0c043a.zip |
LibBareMetal: Don't try to print characters from a null pointer
Diffstat (limited to 'Libraries/LibBareMetal')
-rw-r--r-- | Libraries/LibBareMetal/Output/kprintf.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Libraries/LibBareMetal/Output/kprintf.cpp b/Libraries/LibBareMetal/Output/kprintf.cpp index f064b49fd0..282b4afb31 100644 --- a/Libraries/LibBareMetal/Output/kprintf.cpp +++ b/Libraries/LibBareMetal/Output/kprintf.cpp @@ -155,6 +155,8 @@ static void debugger_putch(char*&, char ch) extern "C" int dbgputstr(const char* characters, int length) { + if (!characters) + return 0; for (int i = 0; i < length; ++i) debugger_out(characters[i]); return 0; @@ -162,6 +164,8 @@ extern "C" int dbgputstr(const char* characters, int length) extern "C" int kernelputstr(const char* characters, int length) { + if (!characters) + return 0; for (int i = 0; i < length; ++i) console_out(characters[i]); return 0; |