Skip Menu |

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

Report information
The Basics
Id: 77432
Status: patched
Priority: 0/
Queue: Net-DNS-ZoneFile-Fast

People
Owner: Nobody in particular
Requestors: FELIPE [...] cpan.org
Cc: felipe [...] felipegasper.com
AdminCc:

Bug Information
Severity: Important
Broken in: 1.16
Fixed in: (no value)



CC: felipe [...] felipegasper.com
The following (character-string encoded) rdata breaks the TXT parser: "\\";" Show quoted text
> perl -MData::Dumper -MNet::DNS::ZoneFile::Fast -e'print
Data::Dumper::Dumper Net::DNS::ZoneFile::Fast::parse(qq{foo IN TXT "\\";"})' $VAR1 = [ bless( { 'ttl' => 0, 'name' => 'foo', 'rdata' => '', 'rdlength' => 0, 'Line' => 1, 'Lines' => 1, 'type' => 'TXT', 'class' => 'IN' }, 'Net::DNS::RR::TXT' ) ]; Note that Net::DNS::RR parses this correctly: Show quoted text
> perl -MData::Dumper -MNet::DNS::RR -e'print Dumper(
Net::DNS::RR->new(qq{foo IN TXT "\\";"}))' $VAR1 = bless( { 'rdlength' => 0, 'ttl' => 0, 'name' => 'foo', 'class' => 'IN', 'type' => 'TXT', 'char_str_list' => [ '";' ], 'rdata' => '' }, 'Net::DNS::RR::TXT' );
Subject: a fix
This seems to fix: elsif (/\G(txt|spf)[ \t]+/igc) { my $type = uc($1); my $txt; if ( /\G("[^\\"]*(?:\\.[^\\"]*)*")$pat_skip/gc ) { $txt = $1; } #RFC 1035 does not define special handling of q{'} in #character-strings, but this module treats it as it does q{"}. elsif ( /\G('[^\\']*(?:\\.[^\\']*)*')$pat_skip/gc ) { $txt = $1; } #If we aren't quoted, only match up to a space or to an unescaped q{;}. elsif ( /\G((?:\\;|[^; \t]*)*)$pat_skip/gc ) { $txt = $1; } if ( defined $txt ) { push @zone, { Line => $ln, name => $domain, type => $type, ttl => $ttl, class => "IN", txtdata => $txt, }; } else { error("bad txtdata in $type"); } }