-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure null-termination in Darwin DNS SD #16043
Conversation
Null-termination was not ensured after strncpy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect if we use Platform::CopyString the code will be clearer and we won't need the cstring header and the extra std:: on strcmp.
PR #16043: Size comparison from 190520d to 8bbee8a Full report (26 builds for cyw30739, efr32, esp32, k32w, linux, mbed, p6, telink)
|
Use CopyString instead of strncpy. Co-authored-by: Boris Zbarsky <[email protected]>
Definitely clearer. Doesn't affect the need for cstring and scope that was missing on strcmp though. |
In src/platform/Darwin/DnssdImpl.h.
PR #16043: Size comparison from 5370ccb to 720091a Full report (27 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
|
* Ensure null-termination in Darwin DNS SD Null-termination was not ensured after strncpy. * Rearrange style * Apply suggestions from code review Use CopyString instead of strncpy. Co-authored-by: Boris Zbarsky <[email protected]> * Add missing header for Darwin DnssdImpl * Use C header for strcmp instead of C++ In src/platform/Darwin/DnssdImpl.h. Co-authored-by: Boris Zbarsky <[email protected]>
Problem
What is being fixed? Examples:
Change overview
Ensure proper null-termination with CopyString.
Testing
How was this tested? (at least one bullet point required)