Skip to content

[app][inetsrv] use correct buffer size in tcp_read#517

Merged
travisg merged 1 commit into
littlekernel:masterfrom
TzengKyle:cocci/so
Jul 2, 2026
Merged

[app][inetsrv] use correct buffer size in tcp_read#517
travisg merged 1 commit into
littlekernel:masterfrom
TzengKyle:cocci/so

Conversation

@TzengKyle

Copy link
Copy Markdown
Contributor

Summary

Fix the buffer size argument passed to tcp_read() in app/inetsrv/inetsrv.c.

The previous code used sizeof(buf), which evaluates to the size of the
pointer rather than the intended buffer capacity. Use ECHO_BUFSIZE instead.

Testing

  • make qemu-virt-arm64-test

Copilot AI review requested due to automatic review settings July 2, 2026 08:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a length argument bug in the app/inetsrv echo server’s read loop, ensuring tcp_read() is passed the actual allocated buffer capacity rather than the size of a pointer.

Changes:

  • Replace sizeof(buf) with ECHO_BUFSIZE when calling tcp_read() in echo_worker().

@travisg travisg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch!

@travisg travisg merged commit 98889d6 into littlekernel:master Jul 2, 2026
120 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants