Skip to content

net: dns: dns_sd: fix incorrect use of buffer size#106441

Open
sebastiaanmerckx-v wants to merge 1 commit intozephyrproject-rtos:mainfrom
copilotone-verhaert:net-mdns-buffer-size-fix
Open

net: dns: dns_sd: fix incorrect use of buffer size#106441
sebastiaanmerckx-v wants to merge 1 commit intozephyrproject-rtos:mainfrom
copilotone-verhaert:net-mdns-buffer-size-fix

Conversation

@sebastiaanmerckx-v
Copy link
Copy Markdown
Contributor

The functions that add DNS records (PTR, SRV, TXT, AAAA, A) all use a buf_size argument which represents the size of the whole buffer, not the remaining size. The higher function that calls these did not provide the correct argument: it passed the remaining size in the buffer.

Copy link
Copy Markdown
Contributor

@rlubos rlubos left a comment

Choose a reason for hiding this comment

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

Nice catch! I've spotted a few more places where this incorrect pattern has been used, can you please update them as well?

@rlubos rlubos added the bug The issue is a bug, or the PR is fixing a bug label Mar 27, 2026
@rlubos rlubos added this to the v4.4.0 milestone Mar 27, 2026
The functions that add DNS records (PTR, SRV, TXT, AAAA, A) all use a
buf_size argument which represents the size of the whole buffer, not the
remaining size. The higher function that calls these did not provide the
correct argument: it passed the remaining size in the buffer.

Signed-off-by: Sebastiaan Merckx <sebastiaan.merckx@verhaert.com>
@sebastiaanmerckx-v sebastiaanmerckx-v force-pushed the net-mdns-buffer-size-fix branch from c77a0e1 to 3dfbdad Compare March 27, 2026 16:00
@sebastiaanmerckx-v
Copy link
Copy Markdown
Contributor Author

@rlubos oh right, thanks for the quick review and suggestions. I've added them.

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Networking bug The issue is a bug, or the PR is fixing a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants