Bug 457085

Summary: CGI.pm bug in exists() on tied param hash
Product: [Fedora] Fedora Reporter: todd_lewis
Component: perlAssignee: Marcela Mašláňová <mmaslano>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: low    
Version: 9CC: kasal, rc040203, robin.norwood, tcallawa
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-09-11 17:00:07 UTC Type: ---
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
demonstrate bug in exists() override for tied hash in CGI.pm none

Description todd_lewis 2008-07-29 15:22:54 UTC
Description of problem: The CGI.pm package's exist() function override for tied
hashes fails. It always reports any given param does not exist. This can
potentially break a _lot_ of CGI scripts.


Version-Release number of selected component (if applicable):
CGI.pm 3.38 (works in 3.37), which was included in
perl-5.10.0-31.fc9.i386 built July 24.

How reproducible: Very; every time.


Steps to Reproduce:
1. Run the attached program like so:
    exists_test.pl a=1 b=2 c=3
2.
3.
  
Actual results:
Key: 'a', does not exist (yet it has value '1').
Deleting $input{a}.
Key: 'a', does not exist.

Key: 'b', does not exist (yet it has value '2').
Deleting $input{b}.
Key: 'b', does not exist.

Key: 'c', does not exist (yet it has value '3').
Deleting $input{c}.
Key: 'c', does not exist.


Expected results:
Key: 'a', does exist (yet it has value '1').
Deleting $input{a}.
Key: 'a', does not exist.

Key: 'b', does exist (yet it has value '2').
Deleting $input{b}.
Key: 'b', does not exist.

Key: 'c', does exist (yet it has value '3').
Deleting $input{c}.
Key: 'c', does not exist.


Additional info: The problem is line 1179 of CGI.pm, which currently reads:
    exists $_[0]->{$_[1]};
but should be:
    exists $_[0]->{param}{$_[1]};

Comment 1 todd_lewis 2008-07-29 15:22:54 UTC
Created attachment 312894 [details]
demonstrate bug in exists() override for tied hash in CGI.pm

Comment 2 Marcela Mašláňová 2008-07-30 07:16:38 UTC
I created ticket for upstream. Thank you for patch, it will be fixed in
perl-5.10.0-32

Comment 3 Fedora Update System 2008-08-12 18:22:21 UTC
perl-5.10.0-33.fc9 has been pushed to the Fedora 9 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update perl'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2008-7171

Comment 4 Fedora Update System 2008-09-11 17:00:01 UTC
perl-5.10.0-33.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.