netutils/netcat: fixed crash on accept() invocation.

Sometimes netcat in server mode crashed with "psock_accept: ERROR: si_accept failed: -9".
And sometimes it crashed with "up_assert: Assertion failed at file:inet/inet_sockif.c line: 841 task: netcat".
This commit is contained in:
Alexander Lunev 2022-02-10 05:21:23 +03:00 committed by Xiang Xiao
parent f4fdf94d53
commit e317d32fe1

View File

@ -174,6 +174,7 @@ int netcat_server(int argc, char * argv[])
goto out;
}
addrlen = sizeof(struct sockaddr_in);
if ((conn = accept(id, (struct sockaddr *)&client, &addrlen)) != -1)
{
result = do_io(conn, outfd,