mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-23 04:55:15 +00:00
LibC: Fix strncpy() overflow in gethostbyname()
This commit is contained in:
parent
038fdc2017
commit
c1607dc41f
Notes:
sideshowbarker
2024-07-19 07:38:16 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/c1607dc41fa
1 changed files with 1 additions and 1 deletions
|
@ -122,7 +122,7 @@ hostent* gethostbyname(const char* name)
|
|||
if (rc <= 0)
|
||||
return nullptr;
|
||||
|
||||
strncpy(__gethostbyname_name_buffer, name, strlen(name));
|
||||
strncpy(__gethostbyname_name_buffer, name, sizeof(__gethostbyaddr_name_buffer) - 1);
|
||||
|
||||
__gethostbyname_buffer.h_name = __gethostbyname_name_buffer;
|
||||
__gethostbyname_buffer.h_aliases = nullptr;
|
||||
|
|
Loading…
Add table
Reference in a new issue