[packages/perl-Crypt-Random] Rel 2: fix makerandom_itv bounds beyond IV range, fixes 32-bit build
arekm
arekm at pld-linux.org
Sat Nov 21 03:15:16 CET 2026
commit c4679eeb50299e2fbf8bc07a0edefc9eeaef02c4
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Sat Nov 21 02:51:53 2026 +0100
Rel 2: fix makerandom_itv bounds beyond IV range, fixes 32-bit build
perl-Crypt-Random-itv-real.patch | 16 ++++++++++++++++
perl-Crypt-Random.spec | 4 +++-
2 files changed, 19 insertions(+), 1 deletion(-)
---
diff --git a/perl-Crypt-Random.spec b/perl-Crypt-Random.spec
index 18b1d62..502d56e 100644
--- a/perl-Crypt-Random.spec
+++ b/perl-Crypt-Random.spec
@@ -8,12 +8,13 @@ Summary: Crypt::Random - cryptographically secure, true random number generator
Summary(pl.UTF-8): Crypt::Random - bezpieczny kryptograficznie, prawdziwy generator liczb losowych
Name: perl-Crypt-Random
Version: 1.57
-Release: 1
+Release: 2
# same as perl
License: GPL v1+ or Artistic
Group: Development/Languages/Perl
Source0: https://www.cpan.org/authors/id/T/TI/TIMLEGGE/%{pdir}-%{pnam}-%{version}.tar.gz
# Source0-md5: a7e704688eb08211de0e6885617e8982
+Patch0: %{name}-itv-real.patch
URL: https://metacpan.org/dist/Crypt-Random
BuildRequires: perl-devel >= 1:5.8.0
BuildRequires: rpm-perlprov >= 4.1-13
@@ -44,6 +45,7 @@ klawiatury i przerwań występujące w systemie operacyjnym.
%prep
%setup -q -n %{pdir}-%{pnam}-%{version}
+%patch -P0 -p1
%build
%{__perl} Makefile.PL \
diff --git a/perl-Crypt-Random-itv-real.patch b/perl-Crypt-Random-itv-real.patch
new file mode 100644
index 0000000..45ae447
--- /dev/null
+++ b/perl-Crypt-Random-itv-real.patch
@@ -0,0 +1,16 @@
+Math::Pari turns a numified Upper/Lower beyond IV range (32-bit: > 2**31) into t_REAL,
+then t_INT % t_REAL dies; a fresh string makes PARI parse the exact integer.
+
+--- Crypt-Random-1.57.orig/lib/Crypt/Random.pm
++++ Crypt-Random-1.57/lib/Crypt/Random.pm
+@@ -88,8 +88,8 @@
+
+ my ( %params ) = @_;
+
+- my $a = $params{ Lower } || 0; $a = PARI ( $a );
+- my $b = $params{ Upper }; $b = PARI ( $b );
++ my $a = $params{ Lower } || 0; $a = PARI ( "$a" );
++ my $b = $params{ Upper }; $b = PARI ( "$b" );
+
+ unless ($b) {
+ die "makerandom_itv needs 'Upper' parameter."
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/perl-Crypt-Random.git/commitdiff/c4679eeb50299e2fbf8bc07a0edefc9eeaef02c4
More information about the pld-cvs-commit
mailing list