From 55bfcb4e07bf8438e654ffca4d86be302d0297b8 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Wed, 3 Apr 2019 15:39:18 +0200 Subject: Perl::Local::VCS_git: Fix an off-by-one error in next_revision() We should be checking whether the commit index is greater than the last index of the @commits array. --- Perl/Local/VCS_git.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Perl') diff --git a/Perl/Local/VCS_git.pm b/Perl/Local/VCS_git.pm index 9c76c0ba969..9bbb17988f8 100644 --- a/Perl/Local/VCS_git.pm +++ b/Perl/Local/VCS_git.pm @@ -1253,7 +1253,7 @@ sub next_revision # way... $pos2 = $pos1 - $move; - if ($pos2 < 0 or $pos2 >= $#commits) { + if ($pos2 < 0 or $pos2 > $#commits) { # Out of range when looking for the new revision $ret = undef; } else { -- cgit v1.2.3