Skip Menu |
 

This queue is for tickets about the HTML-String CPAN distribution.

Report information
The Basics
Id: 92629
Status: new
Priority: 0/
Queue: HTML-String

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

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



Subject: "uninitialized value used in join" crash from no_escape filter
Hello! I think the no_escape filter has a bug that can cause a crash under very specific conditions. On line 41 of TT.pm, if the topic variable is undef, that will cause a "Use of uninitialized value in join or string" warning in the return statement in _hsv_escaped_string. I couldn't figure out a test for it, and I could only reproduce it in my Catalyst app through a weird series of steps. Below is my proposed fix. Please let me know if you'd like me to make any changes. Take care and have a great day! Cheers, Fitz diff --git a/lib/site_perl/5.16.3/HTML/String/TT.pm b/lib/site_perl/5.16.3/HTML/String/TT.pm index 0244de8..1b519e5 100644 --- a/lib/site_perl/5.16.3/HTML/String/TT.pm +++ b/lib/site_perl/5.16.3/HTML/String/TT.pm @@ -38,7 +38,7 @@ sub new { FILTERS => { no_escape => sub { $_[0]->$_isa('HTML::String::Value') ? HTML::String::Value->new(map $_->[0], @{$_[0]->{parts}}) - : HTML::String::Value->new($_) + : HTML::String::Value->new($_[0]) } }, (ref($_[0]) eq 'HASH' ? %{$_[0]} : @_) );


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.