dns_erlang icon indicating copy to clipboard operation
dns_erlang copied to clipboard

Escape backslashes too

Open marc-vanderwal opened this issue 1 year ago • 0 comments

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 avatar Dec 05 '22 11:12 marc-vanderwal