mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-28 21:54:40 +03:00
Userland: Fix nc by not memset()'ing the input address char*
We were accidentally calling memset() on "addr" (the input char*), not "dst_addr" (the target struct sockaddr_in), which was causing a simple "nc localhost 8000" to crash. Fixes #2908.
This commit is contained in:
parent
08c05fbbd1
commit
090c031c1a
Notes:
sideshowbarker
2024-07-19 04:31:50 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/090c031c1a6 Pull-request: https://github.com/SerenityOS/serenity/pull/2909 Issue: https://github.com/SerenityOS/serenity/issues/2908
@ -133,7 +133,7 @@ int main(int argc, char** argv)
|
||||
char addr_str[100];
|
||||
|
||||
struct sockaddr_in dst_addr;
|
||||
memset(&addr, 0, sizeof(addr));
|
||||
memset(&dst_addr, 0, sizeof(dst_addr));
|
||||
|
||||
dst_addr.sin_family = AF_INET;
|
||||
dst_addr.sin_port = htons(port);
|
||||
|
Loading…
Reference in New Issue
Block a user