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:
Linus Groh 2020-07-28 13:15:10 +02:00 committed by Andreas Kling
parent 08c05fbbd1
commit 090c031c1a
Notes: sideshowbarker 2024-07-19 04:31:50 +09:00

View File

@ -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);