Bug#746648: libsnmp-extension-passpersist-perl: bug in by_oid sorting function
Vaclav Bilek
bilek at livesport.eu
Fri May 2 10:00:30 UTC 2014
Package: libsnmp-extension-passpersist-perl
Version: 0.07-3
Severity: important
Tags: patch
Hello
When you compare 2 OIDs but the second is shorter by_oid returns
Use of uninitialized value in numeric comparison (<=>) at
/usr/share/perl5/SNMP/Extension/PassPersist.pm line 530, <STDIN> line
patch:
530c530,534
< $v ||= $a[$_] <=> $b[$_] for 0 .. $#a;
---
> my $i;
> for ( $i=0; $i <= $#a; $i++ ) {
> $v ||= $a[$i] <=> $b[$i];
> if ( $v != 0 || $#b == $i ){last};
> }
$v != 0 ... do not have to process whole @a the first difference makes
result
$#b == $i ... do not try to compare something vith nothing
it makes problems when using snmpwalk while any error output from script
makes snmpd restarting it.
-- System Information:
Debian Release: 6.0.9
Architecture: amd64 (x86_64)
Kernel: Linux 3.2.0-0.bpo.2-amd64 (SMP w/7 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages libsnmp-extension-passpersist-perl depends on:
ii libclass-accessor-perl 0.34-1 Perl module that automatically gen
ii liblist-moreutils-perl 0.25~02-1 Perl module with additional list f
ii perl 5.10.1-17squeeze6 Larry Wall's Practical Extraction
libsnmp-extension-passpersist-perl recommends no packages.
libsnmp-extension-passpersist-perl suggests no packages.
-- no debconf information
-------------- next part --------------
530c530,534
< $v ||= $a[$_] <=> $b[$_] for 0 .. $#a;
---
> my $i;
> for ( $i=0; $i <= $#a; $i++ ) {
> $v ||= $a[$i] <=> $b[$i];
> if ( $v != 0 || $#b == $i ){last};
> }
More information about the pkg-perl-maintainers
mailing list