You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/02/10 04:20:50 UTC

[incubator-nuttx-apps] branch master updated: 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 is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new e317d32  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".
e317d32 is described below

commit e317d32fe1e9fb76ff9f47a256d075cc5332b845
Author: Alexander Lunev <al...@mail.ru>
AuthorDate: Thu Feb 10 05:21:23 2022 +0300

    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".
---
 netutils/netcat/netcat_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/netutils/netcat/netcat_main.c b/netutils/netcat/netcat_main.c
index 1eade12..fc1343c 100644
--- a/netutils/netcat/netcat_main.c
+++ b/netutils/netcat/netcat_main.c
@@ -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,