[perl-Digest-SHA/f18] Deal with calling destructor multiple times

Petr Pisar ppisar at fedoraproject.org
Fri Jun 28 12:13:11 UTC 2013


commit b186646a945e0d41dfccd035710c521b0961a71a
Author: Petr Písař <ppisar at redhat.com>
Date:   Fri Jun 28 14:12:28 2013 +0200

    Deal with calling destructor multiple times

 Digest-SHA-5.84-repeated_shaclose.patch |   30 ++++++++++++++++++++++++++++++
 perl-Digest-SHA.spec                    |    8 +++++++-
 2 files changed, 37 insertions(+), 1 deletions(-)
---
diff --git a/Digest-SHA-5.84-repeated_shaclose.patch b/Digest-SHA-5.84-repeated_shaclose.patch
new file mode 100644
index 0000000..ce08e9d
--- /dev/null
+++ b/Digest-SHA-5.84-repeated_shaclose.patch
@@ -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)
diff --git a/perl-Digest-SHA.spec b/perl-Digest-SHA.spec
index 6d9110e..dbba683 100644
--- a/perl-Digest-SHA.spec
+++ b/perl-Digest-SHA.spec
@@ -1,7 +1,7 @@
 Name:           perl-Digest-SHA
 Epoch:          1
 Version:        5.74
-Release:        3%{?dist}
+Release:        4%{?dist}
 Summary:        Perl extension for SHA-1/224/256/384/512
 License:        GPL+ or Artistic
 Group:          Development/Libraries
@@ -10,6 +10,8 @@ Source0:        http://www.cpan.org/authors/id/M/MS/MSHELOR/Digest-SHA-%{version
 # 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
@@ -39,6 +41,7 @@ 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})'
 
@@ -64,6 +67,9 @@ make test
 %{_mandir}/man3/*
 
 %changelog
+* Fri Jun 28 2013 Petr Pisar <ppisar at redhat.com> - 1:5.74-4
+- Deal with calling destructor multiple times (CPAN RT#86295)
+
 * Wed Jan 16 2013 Jitka Plesnikova <jplesnik at redhat.com> - 1:5.74-3
 - Add patch to fix RT#82655.
 



More information about the perl-devel mailing list