Skip Menu |
 

This queue is for tickets about the MP3-Info CPAN distribution.

Report information
The Basics
Id: 101620
Status: new
Priority: 0/
Queue: MP3-Info

People
Owner: Nobody in particular
Requestors: timon [...] timon.net.nz
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: Patch to fix an infinity loop in _get_v1tag
Download (untitled) / with headers
text/plain 1.1k
Module version: 1.24 Perl versions: 5.8.8 (also tested on 5.16 & 5.18) Loop "while (length($value))" may never ends if $value contains new line characters. This happens because "$" in s/(.)$// regex match the end of the string or _before_ newline at the end of the string. Example (value from real mp3 file): $ perl -lwe 'my $value = pack( "H*", "00cfad0a0ccfad0ab4000000586f770a" ); for ( 1 .. 10 ) { $value =~ s/(.)$//; print unpack( "H*", $value ) }' 00cfad0a0ccfad0ab4000000586f0a 00cfad0a0ccfad0ab4000000580a 00cfad0a0ccfad0ab40000000a 00cfad0a0ccfad0ab400000a 00cfad0a0ccfad0ab4000a 00cfad0a0ccfad0ab40a 00cfad0a0ccfad0a0a 00cfad0a0ccfad0a0a 00cfad0a0ccfad0a0a 00cfad0a0ccfad0a0a After replacing with substr(): $ perl -lwe 'my $value = pack( "H*", "00cfad0a0ccfad0ab4000000586f770a" ); for ( 1 .. 16 ) { substr $value, -1, 1, ""; print unpack( "H*", $value ) }' 00cfad0a0ccfad0ab4000000586f77 00cfad0a0ccfad0ab4000000586f 00cfad0a0ccfad0ab400000058 00cfad0a0ccfad0ab4000000 00cfad0a0ccfad0ab40000 00cfad0a0ccfad0ab400 00cfad0a0ccfad0ab4 00cfad0a0ccfad0a 00cfad0a0ccfad 00cfad0a0ccf 00cfad0a0c 00cfad0a 00cfad 00cf 00 Suggested patch attached.
Subject: Info.pm.patch
Download Info.pm.patch
text/x-diff 294b
--- Info.pm.orig 2015-01-19 16:56:46.000000000 +0300 +++ Info.pm 2015-01-19 16:58:08.000000000 +0300 @@ -652,7 +652,7 @@ # Remove garbage and retry # (string is truncated in the # middle of a multibyte char?) - $value =~ s/(.)$//; + substr($value, -1, 1, ''); } }


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.