summaryrefslogtreecommitdiff
path: root/Kernel/CommandLine.cpp
diff options
context:
space:
mode:
authorsin-ack <sin-ack@users.noreply.github.com>2022-07-11 19:53:29 +0000
committerAndreas Kling <kling@serenityos.org>2022-07-12 23:11:35 +0200
commitc70f45ff4498fcb7ce0671e9107ecff8009d7eb2 (patch)
tree6250cc4ba6c43ed57639f3d7ff9c5fd34800989f /Kernel/CommandLine.cpp
parente3da0adfe6d278424970dad5a642bda650737e42 (diff)
downloadserenity-c70f45ff4498fcb7ce0671e9107ecff8009d7eb2.zip
Everywhere: Explicitly specify the size in StringView constructors
This commit moves the length calculations out to be directly on the StringView users. This is an important step towards the goal of removing StringView(char const*), as it moves the responsibility of calculating the size of the string to the user of the StringView (which will prevent naive uses causing OOB access).
Diffstat (limited to 'Kernel/CommandLine.cpp')
-rw-r--r--Kernel/CommandLine.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/CommandLine.cpp b/Kernel/CommandLine.cpp
index b43487fb5a..1a20968c44 100644
--- a/Kernel/CommandLine.cpp
+++ b/Kernel/CommandLine.cpp
@@ -41,7 +41,7 @@ CommandLine const& kernel_command_line()
UNMAP_AFTER_INIT void CommandLine::initialize()
{
VERIFY(!s_the);
- s_the = new CommandLine(s_cmd_line);
+ s_the = new CommandLine({ s_cmd_line, strlen(s_cmd_line) });
dmesgln("Kernel Commandline: {}", kernel_command_line().string());
// Validate the modes the user passed in.
(void)s_the->panic_mode(Validate::Yes);