Avoid invalid ranges.

Signed-off-by: Nicolás Ortega Froysa <nicolas@ortegas.org>
This commit is contained in:
Nicolás A. Ortega Froysa 2024-03-11 20:09:16 +01:00
parent e6514c37d3
commit 8a62fc9064

View File

@ -125,6 +125,9 @@ $n, $tx->{action}, $tx->{pkg_name}
foreach my $i (@sel) { foreach my $i (@sel) {
if ($i =~ /^[0-9]+-[0-9]+$/) { if ($i =~ /^[0-9]+-[0-9]+$/) {
my ($start, $end) = $i =~ /^([0-9]+)-([0-9]+)$/; my ($start, $end) = $i =~ /^([0-9]+)-([0-9]+)$/;
if ($start >= $end) {
die("Invalid range: $start-$end\n");
}
push(@sel, ($start..$end)); push(@sel, ($start..$end));
} }
} }