diff options
author | Timon Kruiper <timonkruiper@gmail.com> | 2023-01-30 16:27:36 +0100 |
---|---|---|
committer | Jelle Raaijmakers <jelle@gmta.nl> | 2023-02-15 22:53:19 +0100 |
commit | a98c0c3e5131379948482dcc2ca4ffce0c7c463d (patch) | |
tree | 214948f5e8a12857cd77809ce3b50fa45492124f | |
parent | d1eec20773ee881d2e5cadb89332fbff911dc3f1 (diff) | |
download | serenity-a98c0c3e5131379948482dcc2ca4ffce0c7c463d.zip |
Kernel/aarch64: Add implementations for safe_memset and safe_strnlen
They currently do not actually implement a safe memset or safe strnlen,
but this initial implementation works fine for now.
-rw-r--r-- | Kernel/Arch/aarch64/SafeMem.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Kernel/Arch/aarch64/SafeMem.cpp b/Kernel/Arch/aarch64/SafeMem.cpp index 96364cc464..86f6d4f1c3 100644 --- a/Kernel/Arch/aarch64/SafeMem.cpp +++ b/Kernel/Arch/aarch64/SafeMem.cpp @@ -9,16 +9,17 @@ namespace Kernel { -bool safe_memset(void*, int, size_t, void*&) +bool safe_memset(void* dest_ptr, int c, size_t n, void*&) { - TODO_AARCH64(); - return false; + // FIXME: Actually implement a safe memset. + memset(dest_ptr, c, n); + return true; } -ssize_t safe_strnlen(char const*, unsigned long, void*&) +ssize_t safe_strnlen(char const* str, unsigned long max_n, void*&) { - TODO_AARCH64(); - return 0; + // FIXME: Actually implement a safe strnlen. + return strnlen(str, max_n); } bool safe_memcpy(void* dest_ptr, void const* src_ptr, unsigned long n, void*&) |