Process to fix a broken CPAN module?
  Home FAQ Contact Sign in
comp.lang.perl.misc only
 
Advanced search
POPULAR GROUPS

more...

comp.lang.perl.misc Profile…
 Up
Process to fix a broken CPAN module?         


Author: google
Date: May 5, 2008 23:43

I have found a major flaw in a CPAN package. The package is
File::Binary and it has big endian and little endian unpack-ing
backwards. Likewise, all the test files are reversed so that the
tests all pass!

Why do I believe this is true?

From the perl manual on pack:
n,N unpacks a 16 or 32 bit integer in "network" or big endian order
v,V unpacks a 16 or 32 bit integer in "VAX" or little endian order

From the code:
if ($endian == $BIG_ENDIAN) {
$self->{_ui16} = 'v';
$self->{_ui32} = 'V';
} else {
$self->{_ui16} = 'n';
$self->{_ui32} = 'N';
}

When I 'od -x' the test files, they are clearly reversed:
Show full article (1.51Kb)
2 Comments
Re: Process to fix a broken CPAN module?         


Author: Jens Thoms Toerring
Date: May 6, 2008 01:59

google@obmac.org wrote:
> I have found a major flaw in a CPAN package. The package is
> File::Binary and it has big endian and little endian unpack-ing
> backwards. Likewise, all the test files are reversed so that the
> tests all pass!
> Why do I believe this is true?
> From the perl manual on pack:
> n,N unpacks a 16 or 32 bit integer in "network" or big endian order
> v,V unpacks a 16 or 32 bit integer in "VAX" or little endian order
> From the code:
> if ($endian == $BIG_ENDIAN) {
> $self->{_ui16} = 'v';
> $self->{_ui32} = 'V';
> } else {
> $self->{_ui16} = 'n';
> $self->{_ui32} = 'N';
> }
> When I 'od -x' the test files, they are clearly reversed:
Show full article (1.96Kb)
no comments
Re: Process to fix a broken CPAN module?         


Author: rthangam
Date: May 6, 2008 05:14

Jens Thoms Toerring wrote:
> google@obmac.org wrote:
>> I have found a major flaw in a CPAN package. The package is
>> File::Binary and it has big endian and little endian unpack-ing
>> backwards. Likewise, all the test files are reversed so that the
>> tests all pass!
>
>> Why do I believe this is true?
>
>> From the perl manual on pack:
>> n,N unpacks a 16 or 32 bit integer in "network" or big endian order
>> v,V unpacks a 16 or 32 bit integer in "VAX" or little endian order
>
>> From the code:
>> if ($endian == $BIG_ENDIAN) {
>> $self->{_ui16} = 'v';
>> $self->{_ui32} = 'V';
>> } else {
>> $self->{_ui16} = 'n';
>> $self->{_ui32} = 'N'; ...
Show full article (2.25Kb)
no comments