net: dns: dns_sd: fix incorrect use of buffer size#106441
Open
sebastiaanmerckx-v wants to merge 1 commit intozephyrproject-rtos:mainfrom
Open
net: dns: dns_sd: fix incorrect use of buffer size#106441sebastiaanmerckx-v wants to merge 1 commit intozephyrproject-rtos:mainfrom
sebastiaanmerckx-v wants to merge 1 commit intozephyrproject-rtos:mainfrom
Conversation
bed0e8d to
c77a0e1
Compare
rlubos
reviewed
Mar 27, 2026
Contributor
rlubos
left a comment
There was a problem hiding this comment.
Nice catch! I've spotted a few more places where this incorrect pattern has been used, can you please update them as well?
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>
c77a0e1 to
3dfbdad
Compare
rlubos
approved these changes
Mar 27, 2026
Contributor
Author
|
@rlubos oh right, thanks for the quick review and suggestions. I've added them. |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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.