From dbcacad2ae8199d9700673a137b4b01c42fa76f6 Mon Sep 17 00:00:00 2001 From: skreuzer Date: Fri, 19 Aug 2011 21:48:14 +0000 Subject: Fix isse where if an external caller invokes the the method Crypt::RandPasswd->random_chars_in_range(), Perl prepends the object name to the function's argument list. This causes the local variables $minlen, $maxlen, $lo_char, and $hi_char to be set incorrectly ($minlen is set to the object name, $maxlen is set to what should have been the minimum length, $lo_char is set to what should have been the maximum length, and $hi_char is set to what should have been the first character in the given range), so that the method returns an incorrect result. PR: ports/154207 Submitted by: Matthew X. Economou --- security/p5-Crypt-RandPasswd/Makefile | 1 + .../p5-Crypt-RandPasswd/files/patch-lib-Crypt-RandPasswd.pm | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 security/p5-Crypt-RandPasswd/files/patch-lib-Crypt-RandPasswd.pm (limited to 'security') diff --git a/security/p5-Crypt-RandPasswd/Makefile b/security/p5-Crypt-RandPasswd/Makefile index 0ae1826e900f..f2d92e5efefb 100644 --- a/security/p5-Crypt-RandPasswd/Makefile +++ b/security/p5-Crypt-RandPasswd/Makefile @@ -7,6 +7,7 @@ PORTNAME= Crypt-RandPasswd PORTVERSION= 0.02 +PORTREVISION= 1 CATEGORIES= security perl5 MASTER_SITES= CPAN PKGNAMEPREFIX= p5- diff --git a/security/p5-Crypt-RandPasswd/files/patch-lib-Crypt-RandPasswd.pm b/security/p5-Crypt-RandPasswd/files/patch-lib-Crypt-RandPasswd.pm new file mode 100644 index 000000000000..12aa892b3c79 --- /dev/null +++ b/security/p5-Crypt-RandPasswd/files/patch-lib-Crypt-RandPasswd.pm @@ -0,0 +1,10 @@ +--- lib/Crypt/RandPasswd.pm.orig 2011-08-19 17:39:52.000000000 -0400 ++++ lib/Crypt/RandPasswd.pm 2011-08-19 17:40:47.000000000 -0400 +@@ -1466,6 +1466,7 @@ + =cut + + sub random_chars_in_range($$$$) { ++ @_ > 4 and shift; + my( $minlen, $maxlen, $lo_char, $hi_char ) = @_; + + $minlen <= $maxlen or die "minlen $minlen is greater than maxlen $maxlen"; -- cgit