torproject / tor Public
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
#33788: Make things safer when tor_inet_ntop() and tor_inet_ntoa() fail (2) #1902
Merged
torproject-pusher
merged 9 commits into
torproject:master
from
rl1987:ticket33788_rebased
Jun 5, 2020
Merged
#33788: Make things safer when tor_inet_ntop() and tor_inet_ntoa() fail (2) #1902
torproject-pusher
merged 9 commits into
torproject:master
from
rl1987:ticket33788_rebased
Jun 5, 2020
Conversation
…r32 and tor_dup_ip
Something is fishy if we cannot put IP address string into dir-vote line.
Pull Request Test Coverage Report for Build 9048
|
nmathewson
reviewed
Jun 1, 2020
src/feature/relay/dns.c
Outdated
| tor_inet_ntoa(&in, answer_buf, sizeof(answer_buf)); | ||
| wildcard_increment_answer(answer_buf); | ||
| ntoa_res = tor_inet_ntoa(&in, answer_buf, sizeof(answer_buf)); | ||
| tor_assert_nonfatal(ntoa_res > 0); |
This is incorrect; look at the documentation for tor_inet_ntoa(). It says "returns -1 on failure" and "returns non-negative integer on success." So the test should be >= 0.
All three checks for tor_inet_ntoa() return value fixed.
nmathewson
reviewed
Jun 1, 2020
Also, fix a format string.
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.
https://trac.torproject.org/projects/tor/ticket/33788
The text was updated successfully, but these errors were encountered: