mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:57:35 +00: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
1 changed files with 1 additions and 1 deletions
|
@ -133,7 +133,7 @@ int main(int argc, char** argv)
|
||||||
char addr_str[100];
|
char addr_str[100];
|
||||||
|
|
||||||
struct sockaddr_in dst_addr;
|
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_family = AF_INET;
|
||||||
dst_addr.sin_port = htons(port);
|
dst_addr.sin_port = htons(port);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue