Conversation
The hostname buffer passed to dns_poller_init() is block-scoped in main() since 6b4de73, but the poller stored the raw pointer and read it on every poll cycle after the block exited — use of a dead stack object. Copy the hostname in dns_poller_init() and free it in dns_poller_cleanup() instead of relying on the caller's buffer lifetime. The poller owns the copy, so the struct member is a plain char * (no const cast needed to free it). Also: - flipped clang-tidy from wildcard check to finer grained checks to avoid pulling in irrelevant stuff like altera-struct-pack-align. - main.c: check the dns_poller calloc for NULL like every other allocation site; validate -R as an IPv4/IPv6 literal before building the curl resolve entry; warn when -R is ignored because the resolver URL already contains an IP address - doh_proxy.c: don't crash if doh_proxy_await_bootstrap() was given a NULL callback
Owner
Author
|
@baranyaib90, thoughts on any of this? |
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 hostname buffer passed to dns_poller_init() is block-scoped in main() since 6b4de73, but the poller stored the raw pointer and read it on every poll cycle after the block exited — use of a dead stack object. Copy the hostname in dns_poller_init() and free it in dns_poller_cleanup() instead of relying on the caller's buffer lifetime. The poller owns the copy, so the struct member is a plain char * (no const cast needed to free it).
Also: