diff options
author | Jonathan Tan <jonathantanmy@google.com> | 2023-05-08 13:55:40 -0700 |
---|---|---|
committer | Jonathan Tan <jonathantanmy@google.com> | 2023-05-23 13:57:32 -0700 |
commit | 6b3b2b33a528458aa23428db7d43655aa0d883d5 (patch) | |
tree | 900530bace22ab191e7c12c9af1ae71fc47ec75b /org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.24.target | |
parent | 4562e79e234696ae3e1601db9bf8b73a1ef7edf8 (diff) | |
download | jgit-6b3b2b33a528458aa23428db7d43655aa0d883d5.tar.gz jgit-6b3b2b33a528458aa23428db7d43655aa0d883d5.zip |
GraphObjectIndex: fix search in findGraphPosition
In findGraphPosition, when there is no object whose OID starts with
the first byte of the sought OID, low equals high. This violates an
invariant of the loop, and when the sought OID is lexicographically
greater than every other OID in the repository, causes an
ArrayIndexOutOfBoundsException (because we're trying to read outside the
list of OIDs).
Therefore, check the "low < high" condition at the start of the loop,
not only after the first iteration.
Change-Id: Ic8ac198c151bd161c4996b9e7cb6e6660f151733
Helped-by: Ivan Frade <ifrade@google.com>
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Diffstat (limited to 'org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.24.target')
0 files changed, 0 insertions, 0 deletions