pkarashchenko commented on code in PR #7912: URL: https://github.com/apache/nuttx/pull/7912#discussion_r1051586316
########## net/local/local_sockif.c: ########## @@ -380,11 +380,12 @@ static int local_getsockname(FAR struct socket *psock, *addrlen = sizeof(sa_family_t); } - else /* conn->lctype = LOCAL_TYPE_PATHNAME */ + else /* conn->lc_type = LOCAL_TYPE_PATHNAME */ { /* Get the full length of the socket name (incl. null terminator) */ - int namelen = strlen(conn->lc_path) + 1; + int namelen = strlen(conn->lc_path) + 1 + + (conn->lc_type = LOCAL_TYPE_ABSTRACT); Review Comment: ```suggestion (conn->lc_type == LOCAL_TYPE_ABSTRACT); ``` ? ########## net/local/local_sockif.c: ########## @@ -399,8 +400,15 @@ static int local_getsockname(FAR struct socket *psock, /* Copy the path into the user address structure */ - strlcpy(unaddr->sun_path, conn->lc_path, namelen); - unaddr->sun_path[pathlen - 1] = '\0'; + if (conn->lc_type = LOCAL_TYPE_ABSTRACT) Review Comment: ```suggestion if (conn->lc_type == LOCAL_TYPE_ABSTRACT) ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org