Skip Menu |

This queue is for tickets about the SVG CPAN distribution.

Report information
The Basics
Id: 48932
Status: resolved
Priority: 0/
Queue: SVG

People
Owner: Nobody in particular
Requestors: lukas.pietsch [...] freenet.de
Cc:
AdminCc:

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



Subject: bug in SVG::DOM v.2.44
Date: Sat, 22 Aug 2009 14:20:37 +0200
To: bug-SVG [...] rt.cpan.org
From: Lukas Pietsch <lukas.pietsch [...] freenet.de>
Bug report for SVG::DOM v.2.44: The function "findChildIndex" (SVG::DOM, line 520) does not initialise its counting variable "$index" properly before entering the loop. It will return undef rather than zero if called with a $refChild that is in fact its first child. This leads to errors/warnings in other functions that call findChildIndex, such as removeChild: "Use of uninitialized value in numeric lt (<) at /usr/local/share/perl/5.8.8/SVG/DOM.pm line 475. Use of uninitialized value in splice at /usr/local/share/perl/5.8.8/SVG/DOM.pm line 549." The following fix would seem to work: sub findChildIndex { my ($self, $refChild) = @_; my $index = 0; foreach my $child (@{$self->{-childs}}) { return $index if ($child eq $refChild); $index++; } return -1; } Best regards, L. Pietsch
CC:
Subject: RE: [rt.cpan.org #48932] bug in SVG::DOM v.2.44
Date: Sun, 30 Aug 2009 15:55:26 GMT
To: <bug-SVG [...] rt.cpan.org>
From: <ronan.oger [...] roitsystems.com>
Hl Lukas, Thanks for the report. I'll take care of it for the next update release of SVG, some time in September. Ronan From: "Lukas Pietsch via RT" <bug-SVG@rt.cpan.org> Date: 8/22/09 12:21Subject: [rt.cpan.org #48932] bug in SVG::DOM v.2.44 Sat Aug 22 08:21:11 2009: Request 48932 was acted upon. Transaction: Ticket created by lukas.pietsch@freenet.de Queue: SVG Subject: bug in SVG::DOM v.2.44 Broken in: (no value) Severity: (no value) Owner: Nobody Requestors: lukas.pietsch@freenet.de Status: new Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=48932 > Bug report for SVG::DOM v.2.44: The function "findChildIndex" (SVG::DOM, line 520) does not initialise its counting variable "$index" properly before entering the loop. It will return undef rather than zero if called with a $refChild that is in fact its first child. This leads to errors/warnings in other functions that call findChildIndex, such as removeChild: "Use of uninitialized value in numeric lt (<) at /usr/local/share/perl/5.8.8/SVG/DOM.pm line 475. Use of uninitialized value in splice at /usr/local/share/perl/5.8.8/SVG/DOM.pm line 549." The following fix would seem to work: sub findChildIndex { my ($self, $refChild) = @_; my $index = 0; foreach my $child (@{$self->{-childs}}) { return $index if ($child eq $refChild); $index++; } return -1; } Best regards, L. Pietsch
Good catch Lukas! This is fixed now in SVG v2.50. Florent