diff options
author | Linus Groh <mail@linusgroh.de> | 2020-07-28 13:15:10 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-28 13:19:22 +0200 |
commit | 090c031c1a60ee398aa1e1bff25418b1d50583aa (patch) | |
tree | a309c1119d50f111092cb23073a2392567f5aa34 | |
parent | 08c05fbbd10b97bc008a90348fbaeae86cfcee50 (diff) | |
download | serenity-090c031c1a60ee398aa1e1bff25418b1d50583aa.zip |
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.
-rw-r--r-- | Userland/nc.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/nc.cpp b/Userland/nc.cpp index 100be8e849..13fee77f10 100644 --- a/Userland/nc.cpp +++ b/Userland/nc.cpp @@ -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); |