Repository navigation
Conversation
devnexen
reviewed
Dec 1, 2026
Member
There was a problem hiding this comment.
nit: since rdend is cp + i above you can just do cp = rdend; here.
Contributor
Author
There was a problem hiding this comment.
Done, switched to cp = rdend; in bdc2f4d.
devnexen
approved these changes
Dec 1, 2026
bukka
requested changes
Dec 1, 2026
bukka
left a comment
Member
There was a problem hiding this comment.
There is a new testing setup so all dns.c changes should now have a test if possible.
Contributor
Author
|
I added a getmxrr() test with three MX records in b29bc18, so the parser has to step over each RDATA, including a fully compressed exchange name. I could not add a test for the bug itself: BIND will not load an MX record whose name runs past the RDATA, so the zone cannot serve the malformed response. |
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.
dns_get_mx()expanded the MX exchange withdn_expand()bounded by the end of the whole message, not the end of the record's RDATA. An exchange name with no terminating label ran on into the next record, so its owner name ended up in$hosts. The fixed RR header and the preference were also read without checking that they fit in the reply.The exchange is now expanded up to the end of the RDATA, and the header, RDLENGTH and preference are checked against the reply length. A malformed MX record makes
dns_get_mx()return false, the same as whendn_expand()already failed. Tested in a debian container against the crafted UDP server from the issue; a well-formed reply with compressed exchange names still returns the same result. No .phpt, since the BIND-based tests in ext/standard/tests/dns cannot serve a malformed record.Fixes #25954