Bug 1075514 - Crash in Digest::SHA if a method is invoked on an uninitialized object
Summary: Crash in Digest::SHA if a method is invoked on an uninitialized object
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Software Collections
Classification: Red Hat
Component: perl-Digest-SHA
Version: rh-perl520
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: beta
: 2.0
Assignee: perl-maint-list
QA Contact: Martin Kyral
URL: http://nntp.perl.org/group/perl.perl5...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-12 10:16 UTC by Petr Pisar
Modified: 2015-06-04 09:34 UTC (History)
3 users (show)

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.
Clone Of: 1075478
: 1189039 1189041 (view as bug list)
Environment:
Last Closed: 2015-06-04 09:34:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Fix (1.57 KB, patch)
2014-03-12 10:17 UTC, Petr Pisar
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2015:1065 0 normal SHIPPED_LIVE new packages: rh-perl520 2015-06-04 13:24:47 UTC

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


Note You need to log in before you can comment on or make changes to this bug.