Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1075514

Summary: Crash in Digest::SHA if a method is invoked on an uninitialized object
Product: Red Hat Software Collections Reporter: Petr Pisar <ppisar>
Component: perl-Digest-SHAAssignee: perl-maint-list
Status: CLOSED ERRATA QA Contact: Martin Kyral <mkyral>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rh-perl520CC: jorton, kanderso, mkyral
Target Milestone: betaKeywords: Patch
Target Release: 2.0   
Hardware: Unspecified   
OS: Unspecified   
URL: http://nntp.perl.org/group/perl.perl5.porters/213679
Whiteboard:
Fixed In Version: rh-perl520-perl-Digest-SHA-5.93-4.el6,rh-perl520-perl-Digest-SHA-5.93-4.el7 Doc Type: Bug Fix
Doc Text:
Cause: Calling any SHA::Digest method on the class. Consequence: The code crashes. Fix: An upstream released containing the fix was packaged. Result: Calling any SHA::Digest method on class yields a proper exception instead of perl crash.
Story Points: ---
Clone Of: 1075478
: 1189039 1189041 (view as bug list) Environment:
Last Closed: 2015-06-04 09:34:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Fix none

Description Petr Pisar 2014-03-12 10:16:21 UTC
+++ This bug was initially created as a clone of Bug #1075478 +++

If Digest::SHA's method is called on an unintialized object (missing Digest::SHA->new()), the Digest::SHA crashes:

$ perl -MData::Dumper -e 'use Digest::SHA; $d=Digest::SHA->add(); print Data::Dumper::Dumper(\$d);'
Segmentation fault

$ perl -e 'use Digest::SHA; print Digest::SHA->add(qq(a))->hexdigest'
Segmentation fault

This has been fixed in Digest-SHA-5.87. F19 and F20 are affected.

--- Additional comment from Petr Pisar on 2014-03-12 09:40:02 GMT ---

Test:

perl -e 'use Digest::SHA; $d=Digest::SHA->add(qq(a)); for (qw(shaclose shadump shadup shaload shaopen sharewind shawrite hashsize add digest)) { eval {$d->$_}; die "$_: $@" unless $@ =~ /on an undefined value/ }'

----

RHSCL-1.1 is affected (perl516-perl-Digest-SHA-5.85-2.el6).

Comment 1 Petr Pisar 2014-03-12 10:17:06 UTC
Created attachment 873421 [details]
Fix

Comment 5 errata-xmlrpc 2015-06-04 09:34:00 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHEA-2015-1065.html