diff options
author | sin-ack <sin-ack@users.noreply.github.com> | 2022-07-11 19:53:29 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-07-12 23:11:35 +0200 |
commit | c70f45ff4498fcb7ce0671e9107ecff8009d7eb2 (patch) | |
tree | 6250cc4ba6c43ed57639f3d7ff9c5fd34800989f /Kernel/Arch/x86 | |
parent | e3da0adfe6d278424970dad5a642bda650737e42 (diff) | |
download | serenity-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/Arch/x86')
-rw-r--r-- | Kernel/Arch/x86/common/Processor.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Arch/x86/common/Processor.cpp b/Kernel/Arch/x86/common/Processor.cpp index ff388b22a8..e76fc36840 100644 --- a/Kernel/Arch/x86/common/Processor.cpp +++ b/Kernel/Arch/x86/common/Processor.cpp @@ -710,7 +710,7 @@ UNMAP_AFTER_INIT void Processor::detect_hypervisor_hyperv(CPUID const& hyperviso alignas(sizeof(u32)) char interface_signature_buffer[5]; *reinterpret_cast<u32*>(interface_signature_buffer) = hypervisor_interface.eax(); interface_signature_buffer[4] = '\0'; - StringView hyperv_interface_signature(interface_signature_buffer); + StringView hyperv_interface_signature { interface_signature_buffer, strlen(interface_signature_buffer) }; dmesgln("CPU[{}]: Hyper-V interface signature '{}' ({:#x})", current_id(), hyperv_interface_signature, hypervisor_interface.eax()); |