-
Notifications
You must be signed in to change notification settings - Fork 538
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
Avoid UB when packing a domain name #1613
Conversation
Can one of the admins verify this patch? |
Using
|
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.
Thank you for working on fixing this bug!
When I suggested the new comment text, I did not know that RFC 1034 had the following text: the null (i.e., zero length) label used for the root.
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.
Thank you for addressing my primary concern. I am approving this PR after polishing its code and PR metadata a little. @jtstrs, please double check my changes.
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.
We still have the UB implied by potential memcpy()
mistakes. But replacing the one in label packing with memove()
can be done when the other ones are updated.
OK to test |
rfc1035NamePack() called rfc1035LabelPack() with a nil label buffer. Feeding memcpy() a nil buffer is undefined behavior, even if size is 0.
OK to test |
rfc1035NamePack() called rfc1035LabelPack() with a nil label buffer. Feeding memcpy() a nil buffer is undefined behavior, even if size is 0.
rfc1035NamePack() called rfc1035LabelPack() with a nil label buffer.
Feeding memcpy() a nil buffer is undefined behavior, even if size is 0.