Old-Ding opened a new pull request, #3601:
URL: https://github.com/apache/nuttx-apps/pull/3601

   ## Summary
   - compute udgram and ustream Unix-domain pathname lengths with `strnlen()`
   - copy with space for the terminating NUL
   - pass `sizeof(sa_family_t) + strlen(path) + 1` to `bind()`, `connect()`, 
and `sendto()`
   
   ## Why
   The examples used `sizeof(CONFIG_EXAMPLES_*_ADDR)` as the pathname length 
and then added another NUL byte to the sockaddr length. For maximum-length 
paths this can make the supplied address length one byte larger than `struct 
sockaddr_un`.
   
   The stream example also wrote `sun_path[addrlen] = '\0'` after clamping 
`addrlen` to `UNIX_PATH_MAX`, which can write one byte past `sun_path`.
   
   ## Testing
   - `git diff --check HEAD~1..HEAD`
   - `git show --stat --check --format=fuller HEAD`
   - Not run: local NuttX apps build, because this Windows workstation does not 
have `gcc`, `clang`, or `cc` installed.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to