Subject: | Deep recursion in checktype_contents() |
checktype_contents() gets into an infinite loop by calling itself whenever the length of its
$data argument is greater than zero:
Deep recursion on subroutine "File::MMagic::checktype_contents" at
/usr/lib/perl5/site_perl/5.8.8/File/MMagic.pm line 631.
This is the file signature:
#
# $Id: MMagic.pm 282 2012-05-31 07:36:36Z knok $
#
This is an excerpt of the guilty sub:
----
sub checktype_contents {
my $self = shift;
my $data = shift;
my $mtype;
return 'application/octet-stream' if (length($data) <= 0);
$mtype = checktype_contents($self, $data);
return $mtype unless $mtype eq "";
-----
You possibly meant to call checktype_container?
How to replicate:
use File::MMagic;
my $mm = new File::MMagic;
$mm->checktype_contents('a');