mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-22 09:12:13 -05:00
Kernel: Remove strcpy()
These are not called in the kernel or by libstdc++ anyway. Remove the tempting function, and prevent future overflows.
This commit is contained in:
parent
9795c61464
commit
d5b7c28a5e
Notes:
sideshowbarker
2024-07-19 03:14:44 +09:00
Author: https://github.com/BenWiederhake Commit: https://github.com/SerenityOS/serenity/commit/d5b7c28a5ef Pull-request: https://github.com/SerenityOS/serenity/pull/3275 Reviewed-by: https://github.com/awesomekling
2 changed files with 0 additions and 11 deletions
|
@ -97,15 +97,6 @@ const void* memmem(const void* haystack, size_t haystack_length, const void* nee
|
|||
return AK::memmem(haystack, haystack_length, needle, needle_length);
|
||||
}
|
||||
|
||||
char* strcpy(char* dest, const char* src)
|
||||
{
|
||||
auto* dest_ptr = dest;
|
||||
auto* src_ptr = src;
|
||||
while ((*dest_ptr++ = *src_ptr++) != '\0')
|
||||
;
|
||||
return dest;
|
||||
}
|
||||
|
||||
void memset_user(void* dest_ptr, int c, size_t n)
|
||||
{
|
||||
ASSERT(Kernel::is_user_range(VirtualAddress(dest_ptr), n));
|
||||
|
|
|
@ -42,7 +42,6 @@ void copy_from_user(void*, const void*, size_t);
|
|||
void memset_user(void*, int, size_t);
|
||||
|
||||
void* memcpy(void*, const void*, size_t);
|
||||
char* strcpy(char*, const char*);
|
||||
int strncmp(const char* s1, const char* s2, size_t n);
|
||||
char* strstr(const char* haystack, const char* needle);
|
||||
int strcmp(char const*, const char*);
|
||||
|
@ -69,7 +68,6 @@ inline void copy_to_user(T* dest, const T* src)
|
|||
copy_to_user(dest, src, sizeof(T));
|
||||
}
|
||||
|
||||
|
||||
template<typename T>
|
||||
inline void copy_from_user(T* dest, Userspace<const T*> src)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue