yushuailong opened a new pull request, #20221:
URL: https://github.com/apache/nuttx/pull/20221
## Summary
Fix line buffer overreads when generating `/proc/modules` and `/proc/irqs`.
Both callbacks formatted an entry using `snprintf()` and passed its return
value to `procfs_memcpy()`. When the formatted output was larger than the line
buffer, `snprintf()` returned the length that would have been written, rather
than the number of bytes stored in the buffer. As a result, `procfs_memcpy()`
could read beyond the end of the formatting buffer.
Use `procfs_snprintf()`, which returns the number of bytes actually
stored, so the subsequent copy is limited to valid buffer contents.
## Impact
bug fix only
## Testing
Build host: macOS 26.6.2 ARM64, Apple Clang 21.0.0.
Target: sim:ostest.
Build: make completes successfully with LD: nuttx.
Static checks: nxstyle, checkpatch pass.
Runtime smoke test: ./nuttx starts and proceeds through enabled OSTest cases
without an assertion in the observed run.
--
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]