Bug 457085 - CGI.pm bug in exists() on tied param hash
Summary: CGI.pm bug in exists() on tied param hash
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: perl
Version: 9
Hardware: All
OS: Linux
low
high
Target Milestone: ---
Assignee: Marcela Mašláňová
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-07-29 15:22 UTC by todd_lewis
Modified: 2008-09-11 17:00 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-09-11 17:00:07 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
demonstrate bug in exists() override for tied hash in CGI.pm (704 bytes, text/plain)
2008-07-29 15:22 UTC, todd_lewis
no flags Details

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.


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