Subject: | Complex regular subexpression recursion limit (32766) |
Hi there,
we stumbled on a bug when trying to load a yaml file with more than 32766 chars as a value.
Here's how to reproduce:
1.) Download the attached example YAML file and create a perl test script from:
#!/usr/bin/perl
use strict;
use warnings;
use YAML;
my @File = <STDIN>;
my $String = join("", @File);
my $YAML = YAML::Load( $String );
2.) Execute:
cat Example.yaml | ./yourscript.pl
3.) Get Error:
YAML Error: Can't parse double quoted string
Code: YAML_PARSE_ERR_BAD_DOUBLE
Line: 3
Document: 1
at /Library/Perl/5.16/YAML/Loader.pm line 523.
More detailed error:
Complex regular subexpression recursion limit (32766) exceeded at /Library/Perl/5.16/YAML/Loader.pm line 523.
Caused by this line:
if ($self->inline =~ /^"((?:\\"|[^"])*)"\s*(.*)$/) {
Fixed with this line:
if ($self->inline =~ /^"((?:(?:\\"|[^"]){0,32766}+){0,32766}+)"\s*(.*)$/) {
Happens with perl 5.16 (OSX), YAML 0.84.
Greetings,
Thorsten
// from znuny with love
Subject: | Example.yaml |
Message body is not shown because it is too large.