Skip Menu |

This queue is for tickets about the XML-Pastor CPAN distribution.

Report information
The Basics
Id: 89965
Status: new
Priority: 0/
Queue: XML-Pastor

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

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



Subject: Deep recursion on includeSchema
Schema includes can cause deep recursion and eventually OOM.
--- lib/XML/Pastor/Schema/Parser.pm +++ lib/XML/Pastor/Schema/Parser.pm @@ -37,6 +37,10 @@ sub new () { unless ($self->{contextStack}) { $self->{contextStack} = XML::Pastor::Stack->new(); } + + unless ($self->{seenSchema}) { + $self->{seenSchema} = { }; + } return bless $self, $class; } @@ -172,6 +176,13 @@ sub _process { } return $self->model(); } + + if ($self->{seenSchema}{$schema}) { + print STDERR "Pastor : Skipping duplicate schema : '$args->{schema}' ...\n" if($verbose >= 2); + return $self->model(); + } + + $self->{seenSchema}{$schema} = 1; print STDERR "Pastor : Processing schema : '$args->{schema}' ...\n" if($verbose >= 2);