[hardening-discuss] Bug#682451: hardening-includes: length() used on %libc (did you mean "scalar(keys %libc)"?)

Jonathan Nieder jrnieder at gmail.com
Sun Jul 22 20:41:50 UTC 2012


Package: hardening-includes
Version: 2.2

Hi,

perl 5.16 warns when running lintian:

	Now running lintian...
	length() used on %libc (did you mean "scalar(keys %libc)"?) at /usr/bin/hardening-check line 239.
	length() used on %libc (did you mean "scalar(keys %libc)"?) at /usr/bin/hardening-check line 239.

Indeed, length(%libc) gives the length of scalar(%libc), which would
generally not be less than 3.

How about something like this patch?

diff --git i/hardening-check w/hardening-check
index e62f6fc6..c18ec5a9 100755
--- i/hardening-check
+++ w/hardening-check
@@ -160,7 +160,7 @@ if ($find_libc_functions) {
     }
     exit(0);
 }
-die "List of libc functions not defined!" if (length(%libc) == 1);
+die "List of libc functions not defined!" if (scalar(keys %libc) <= 1);
 
 my $name;
 foreach my $file (@ARGV) {



More information about the hardening-discuss mailing list