Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CGI CPAN distribution.

Report information
The Basics
Id: 79458
Status: resolved
Priority: 0/
Queue: CGI

People
Owner: Nobody in particular
Requestors: gerph [...] gerph.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Unsafe code (my ... if (...)) in _style
Download (untitled) / with headers
text/plain 594b
In _style, there is: my @c = ref($code) eq 'ARRAY' ? @$code : $code if $code; This is unsafe. "my <var> ... if <condition>" has undefined behaviour in the case of <condition> being false. From perlsyn: NOTE: The behaviour of a "my" statement modified with a statement modifier conditional or loop construct (e.g. "my $x if ...") is undefined. The value of the "my" variable may be "undef", any previously assigned value, or possibly anything else. Don't rely on it. Future versions of perl might do something different from the version of perl you try it out on. Here be dragons.
Subject: Re: [rt.cpan.org #79458] Unsafe code (my ... if (...)) in _style
Date: Fri, 07 Sep 2012 16:09:18 -0400
To: bug-CGI [...] rt.cpan.org
From: Mark Stosberg <mark [...] summersault.com>
Download (untitled) / with headers
text/plain 657b
Show quoted text
> In _style, there is: > > my @c = ref($code) eq 'ARRAY' ? @$code : $code if $code; > > This is unsafe. "my <var> ... if <condition>" has undefined behaviour in > the case of <condition> being false. > > From perlsyn: > > NOTE: The behaviour of a "my" statement modified with a statement > modifier conditional or loop construct (e.g. "my $x if ...") is > undefined. The value of the "my" variable may be "undef", any > previously assigned value, or possibly anything else. Don't rely on > it. Future versions of perl might do something different from the > version of perl you try it out on. Here be dragons.
Thanks for the report. Mark
Download (untitled) / with headers
text/plain 120b
Sent a pull request for this issue: https://github.com/markstos/CGI.pm/pull/31 -- Alexandr Ciornii, http://chorny.net
Download (untitled) / with headers
text/plain 241b
This issue has been copied to: https://github.com/leejo/CGI.pm/issues/101 please take all future correspondence there. This ticket will remain open but please do not reply here. This ticket will be closed when the github issue is dealt with.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.