File::GetLineMaxLength

Get lines from a file, up to a maximum line length
Download

File::GetLineMaxLength Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Rob Mueller
  • Publisher web site:
  • http://search.cpan.org/~robm/Mail-IMAPTalk-1.03/IMAPTalk.pm

File::GetLineMaxLength Tags


File::GetLineMaxLength Description

Get lines from a file, up to a maximum line length File::GetLineMaxLength is a Perl module to get lines from a file, up to a maximum line length.SYNOPSIS use File::GetLineMaxLength; $FML = File::GetLineMaxLength->new(STDIN); # Read lines, up to 1024 chars while (my $Line = $FML->getline(1024, $Excess)) { }While generally reading lines of data is easy in perl (eg ), there's apparently no easy way to limit the read line to a maximum length (as in the C call fgets(char *s, int size, FILE *stream)). This can lead to potential DOS situations in your code where an attacker can send an arbitrarily large line and use up all your memory. Of course you can use things like BSD::Resource to stop your program using all memory, but that just kills off the process and gives you no more information about what was causing the problem. Requirements: · Perl


File::GetLineMaxLength Related Software