Skip Menu |

This queue is for tickets about the Net-DNS CPAN distribution.

Report information
The Basics
Id: 96755
Status: resolved
Priority: 0/
Queue: Net-DNS

People
Owner: Nobody in particular
Requestors: Mark.Martinec [...] ijs.si
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 0.77
Fixed in: (no value)



Subject: RFC 3597 (hex) parsing mistake
Looks like a mistake in the current trunk/r1223 (0.77+): $ perl -MNet::DNS::RR -lwe 'Net::DNS::RR->new("e.example. IN A \\#")->print' Argument "\\#" isn't numeric in pack at ../5.20/mach/Net/DNS/RR/A.pm line 62. e.example. 0 IN A 0.0.0.0 The fix: --- lib/Net/DNS/RR.pm (revision 1223) +++ lib/Net/DNS/RR.pm (working copy) @@ -141 +141 @@ - if ( $#token && $token[0] =~ /^[\\]?#$/ ) { + if ( @token && $token[0] =~ /^[\\]?#$/ ) { Gives: $ perl -MNet::DNS::RR -lwe 'Net::DNS::RR->new("e.example. IN A \\#")->print' e.example. 0 IN A ; no data
From: rwfranks [...] acm.org
On Thu Jun 26 20:16:44 2014, Mark.Martinec@ijs.si wrote: Show quoted text
> Looks like a mistake in the current trunk/r1223 (0.77+):
[snip] Claiming this to be a parsing error is inappropriate when the string you offer is itself unparsable. The issue is really a failure to detect your mistake. [RFC3597] If the RDATA is of zero length, the text representation contains only the \# token and the single zero representing the length. Your proposed solution attempts to parse the unparsable text, which is as unacceptable as not detecting the error.
From: rwfranks [...] acm.org
Thinking about this again, I conclude that it is unreasonable to assume that the appearance of "\#" as first token in the RDATA indicates that what follows is RFC3597 hexadecimal format. The obvious counter-example is: TXT "\#" "non-numeric string" Perhaps you deserved to be sent off instead of the yellow card! $ perl -MNet::DNS::RR -lwe 'Net::DNS::RR->new("e.example. IN A \\#")->print' Argument "\\#" isn't numeric in pack at /home/rwf/devel/Net/DNS/RR/A.pm line 62. in new Net::DNS::RR( e.example. IN A \# ... ) at -e line 1.
From: rwfranks [...] acm.org
Fixed in 0.78 Warning now raises an exception
Fail on non parsable rdata length indicator is in 0.78