Bug 1075504

Summary: Crash in Digest::SHA if a method is invoked on an uninitialized object
Product: Red Hat Enterprise Linux 7 Reporter: Petr Pisar <ppisar>
Component: perl-Digest-SHAAssignee: perl-maint-list
Status: CLOSED DUPLICATE QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0Keywords: Patch
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: http://nntp.perl.org/group/perl.perl5.porters/213679
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1075478 Environment:
Last Closed: 2015-02-09 14:36:09 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 09:52:24 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/ }'

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

RHEL-7 is affected (perl-Digest-SHA-5.85-3.el7.x86_64).

Comment 1 Petr Pisar 2014-03-12 09:52:50 UTC
Created attachment 873414 [details]
Fix

Comment 2 Petr Pisar 2015-02-09 14:36:09 UTC

*** This bug has been marked as a duplicate of bug 1189039 ***