Skip Menu |

This queue is for tickets about the POE CPAN distribution.

Report information
The Basics
Id: 18551
Status: resolved
Priority: 0/
Queue: POE

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

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



Subject: POE::Filter::Map does not change params are callable
POE::Filter::Map takes three params. It assumes they are callable (CODE references or overloaded-callable objects) without testing them.
Log Message: ----------- Patched Filter::Map to close rt18551 Added sanity check to modify() Modified Paths: -------------- trunk/poe/lib/POE/Filter/Map.pm Modified: trunk/poe/lib/POE/Filter/Map.pm =================================================================== --- trunk/poe/lib/POE/Filter/Map.pm 2006-04-29 22:58:20 UTC (rev 1947) +++ trunk/poe/lib/POE/Filter/Map.pm 2006-04-30 06:35:56 UTC (rev 1948) @@ -34,6 +34,11 @@ defined($params{Code}) or (defined($params{Get}) and defined($params{Put})) ); + croak "Code element is not a subref" + unless (defined $params{Code} and ref $params{Code} eq 'CODE'); + croak "Get or Put element is not a subref" + unless ((defined $params{Get} and ref $params{Get} eq 'CODE') + and (defined $params{Put} and ref $params{Put} eq 'CODE')); my $self = bless [ [ ], # BUFFER @@ -89,6 +94,7 @@ my ($self, %params) = @_; for (keys %params) { next unless ($_ eq 'Put') || ($_ eq 'Get') || ($_ eq 'Code'); + croak "$_ element must be a subref" unless ref $params{$_} eq 'CODE'; $self->[ { Put => CODEPUT,