mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:47:45 +00:00
LibC: Fix strncpy() overflow in gethostbyname()
This commit is contained in:
parent
038fdc2017
commit
c1607dc41f
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
Add a link
Reference in a new issue