Compare commits

...

6 Commits
master ... f18

Author SHA1 Message Date
Petr Písař
b186646a94 Deal with calling destructor multiple times 2013-06-28 14:12:28 +02:00
Jitka Plesnikova
df794aefcc Fix RT#82655 2013-01-16 13:09:35 +01:00
Petr Písař
7e6efce697 Restore epoch value broken in 5.73 bump 2012-11-30 12:00:10 +01:00
Petr Písař
2941ce3584 5.74 bump 2012-11-26 09:28:45 +01:00
Petr Písař
2a7c945b20 5.73 bump 2012-11-26 09:28:41 +01:00
Petr Písař
a1e399073e 5.72 bump 2012-09-26 10:00:59 +02:00
5 changed files with 110 additions and 5 deletions

3
.gitignore vendored
View File

@ -1,3 +1,6 @@
Digest-SHA-5.45.tar.gz
/Digest-SHA-5.70.tar.gz
/Digest-SHA-5.71.tar.gz
/Digest-SHA-5.72.tar.gz
/Digest-SHA-5.73.tar.gz
/Digest-SHA-5.74.tar.gz

View File

@ -0,0 +1,47 @@
--- Digest-SHA-5.74/lib/Digest/SHA.pm.orig 2013-01-16 10:44:33.185972614 +0100
+++ Digest-SHA-5.74/lib/Digest/SHA.pm 2013-01-16 10:47:37.127369861 +0100
@@ -50,7 +50,7 @@
return($class);
}
shaclose($$class) if $$class;
- $$class = shaopen($alg) || return;
+ return unless $$class = shaopen($alg);
return($class);
}
$alg = 1 unless defined $alg;
@@ -163,18 +163,21 @@
sub dump {
my $self = shift;
- my $file = shift || "";
+ my $file = shift;
+ $file = "" unless defined $file;
shadump($file, $$self) || return;
return($self);
}
sub load {
my $class = shift;
- my $file = shift || "";
+ my $file = shift;
+
+ $file = "" unless defined $file;
if (ref($class)) { # instance method
shaclose($$class) if $$class;
- $$class = shaload($file) || return;
+ return unless $$class = shaload($file);
return($class);
}
my $state = shaload($file) || return;
--- Digest-SHA-5.74/src/sha.c.orig 2013-01-16 10:49:43.624336994 +0100
+++ Digest-SHA-5.74/src/sha.c 2013-01-16 10:51:33.661168900 +0100
@@ -272,7 +272,7 @@
/* shaopen: creates a new digest object */
SHA *shaopen(int alg)
{
- SHA *s;
+ SHA *s = NULL;
if (alg != SHA1 && alg != SHA224 && alg != SHA256 &&
alg != SHA384 && alg != SHA512 &&

View File

@ -0,0 +1,30 @@
Workaround for repeated calls to shaclose()
CPAN RT#86295
Ported from Digest-SHA-5.85.
diff -Naru Digest-SHA-5.84/lib/Digest/SHA.pm Digest-SHA-5.85/lib/Digest/SHA.pm
--- Digest-SHA-5.84/lib/Digest/SHA.pm 2013-03-10 01:36:10.000000000 +0100
+++ Digest-SHA-5.85/lib/Digest/SHA.pm 2013-06-26 13:05:27.000000000 +0200
@@ -62,7 +62,7 @@
sub DESTROY {
my $self = shift;
- shaclose($$self) if $$self;
+ if ($$self) { shaclose($$self); $$self = undef }
}
sub clone {
diff -Naru Digest-SHA-5.84/SHA.xs Digest-SHA-5.85/SHA.xs
--- Digest-SHA-5.84/SHA.xs 2013-03-09 21:38:02.000000000 +0100
+++ Digest-SHA-5.85/SHA.xs 2013-06-23 17:16:35.000000000 +0200
@@ -31,6 +31,9 @@
int
shaclose(s)
SHA * s
+CODE:
+ RETVAL = shaclose(s);
+ sv_setiv(SvRV(ST(0)), 0);
int
shadump(file, s)

View File

@ -1,12 +1,18 @@
Name: perl-Digest-SHA
Epoch: 1
Version: 5.71
Release: 5%{?dist}
Version: 5.74
Release: 4%{?dist}
Summary: Perl extension for SHA-1/224/256/384/512
License: GPL+ or Artistic
Group: Development/Libraries
URL: http://search.cpan.org/dist/Digest-SHA/
Source0: http://www.cpan.org/authors/id/M/MS/MSHELOR/Digest-SHA-%{version}.tar.gz
# Fix double-free when loading Digest::SHA object
# https://rt.cpan.org/Public/Bug/Display.html?id=82655
Patch0: Digest-SHA-5.81-Fix-RT82655.patch
# Fix for multiple destructor call, CPAN RT#86295
Patch1: Digest-SHA-5.84-repeated_shaclose.patch
BuildRequires: perl(ExtUtils::MakeMaker)
# Run-time
BuildRequires: perl(Carp)
@ -34,6 +40,8 @@ handle all types of input, including partial-byte data.
%prep
%setup -q -n Digest-SHA-%{version}
%patch0 -p1
%patch1 -p1
chmod -x examples/*
perl -MExtUtils::MakeMaker -e 'ExtUtils::MM_Unix->fixin(q{examples/dups})'
@ -42,10 +50,9 @@ perl -MExtUtils::MakeMaker -e 'ExtUtils::MM_Unix->fixin(q{examples/dups})'
make %{?_smp_mflags}
%install
make pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT
make pure_install DESTDIR=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} \;
find $RPM_BUILD_ROOT -type f -name '*.bs' -size 0 -exec rm -f {} \;
find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null \;
%{_fixperms} $RPM_BUILD_ROOT/*
%check
@ -60,6 +67,24 @@ make test
%{_mandir}/man3/*
%changelog
* Fri Jun 28 2013 Petr Pisar <ppisar@redhat.com> - 1:5.74-4
- Deal with calling destructor multiple times (CPAN RT#86295)
* Wed Jan 16 2013 Jitka Plesnikova <jplesnik@redhat.com> - 1:5.74-3
- Add patch to fix RT#82655.
* Fri Nov 30 2012 Petr Pisar <ppisar@redhat.com> - 1:5.74-2
- Restore epoch value broken in 5.73 bump
* Mon Nov 26 2012 Petr Pisar <ppisar@redhat.com> - 0:5.74-1
- 5.74 bump
* Thu Nov 01 2012 Petr Pisar <ppisar@redhat.com> - 0:5.73-2
- 5.73 bump
* Wed Sep 26 2012 Petr Pisar <ppisar@redhat.com> - 1:5.72-1
- 5.72 bump
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:5.71-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

View File

@ -1 +1 @@
f40aeb91b6fe62ed4bf47ceb86382305 Digest-SHA-5.71.tar.gz
671d35a73c0feaf38533465f5355aaa2 Digest-SHA-5.74.tar.gz