Skip Menu |

This queue is for tickets about the RRD-Editor CPAN distribution.

Report information
The Basics
Id: 124355
Status: resolved
Priority: 0/
Queue: RRD-Editor

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

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



Subject: delete_RRA bugs
delete_RRA validation allows index above rra_cnt. delete_RRA does not delete last RRA after shift. @@ -889,14 +889,12 @@ sub add_RRA { sub delete_RRA { # delete an RRA my ($self, $idx) = @_; my $rrd=$self->{rrd}; - if ($idx > $rrd->{rra_cnt} || $idx<0) {croak("RRA index out of range\n");} + if ($idx >= $rrd->{rra_cnt} || $idx<0) {croak("RRA index out of range\n");} # load RRA data, if not already loaded if (!defined($rrd->{dataloaded})) {$self->_loadRRAdata;} # update RRA $rrd->{rra_cnt}--; - for (my $i=$idx; $i<$rrd->{rra_cnt}; $i++) { - $rrd->{rra}[$i]=$rrd->{rra}[$i+1]; - } + splice(@{$rrd->{rra}}, $idx, 1); return 1; }
Taken into 0.19.