Skip to content

Escape backslashes too #28

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

marc-vanderwal
Copy link

When a packet is received with a query for \\.test (that is, a name with two labels, one composed of only a backslash character, and the label “test”), labels_to_dname() decodes it to "\.test". Calling dname_to_labels() again on that result yields \.test (that is, a name with one label, “.test”) instead of \\.test.

The solution is to also backslash-escape the backslash character.

@marc-vanderwal marc-vanderwal force-pushed the bugfix/escape-backslashes-too branch from 5f5eb9b to ab3a7c7 Compare December 5, 2022 12:20
When a packet is received with a query for \\.test (that is, a name with
two labels, one composed of only a backslash character, and the label
“test”), labels_to_dname() decodes it to "\\.test". Calling
dname_to_labels() again on that result yields \.test (that is, a name
with one label, “.test”) instead of \\.test.

The solution is to also backslash-escape the backslash character.

This commit also adds corresponding unit tests to that effect.
@NelsonVides NelsonVides force-pushed the bugfix/escape-backslashes-too branch from ab3a7c7 to a2d82a8 Compare April 11, 2025 05:32
@NelsonVides NelsonVides self-assigned this Apr 11, 2025
@NelsonVides NelsonVides requested review from weppos and DXTimer April 11, 2025 05:33
@coveralls
Copy link

coveralls commented Apr 11, 2025

Pull Request Test Coverage Report for Build 14396318806

Details

  • 10 of 10 (100.0%) changed or added relevant lines in 1 file are covered.
  • 48 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.04%) to 72.488%

Files with Coverage Reduction New Missed Lines %
src/DNS-ASN1.erl 48 0.0%
Totals Coverage Status
Change from base Build 14396017829: 0.04%
Covered Lines: 1017
Relevant Lines: 1403

💛 - Coveralls

1 similar comment
@coveralls
Copy link

Pull Request Test Coverage Report for Build 14396318806

Details

  • 10 of 10 (100.0%) changed or added relevant lines in 1 file are covered.
  • 48 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.04%) to 72.488%

Files with Coverage Reduction New Missed Lines %
src/DNS-ASN1.erl 48 0.0%
Totals Coverage Status
Change from base Build 14396017829: 0.04%
Covered Lines: 1017
Relevant Lines: 1403

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants