summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorDariusz Luksza2011-09-06 04:12:39 (EDT)
committer Dariusz Luksza2011-09-06 04:12:39 (EDT)
commit570d862ef3874e39a378a0268b120aeb02aa7718 (patch)
treea5b38171651d6267643a38b76bae1e322907257f
parentb695f66487dfdc5cfe3e3dd22c0253801ecdc9b9 (diff)
downloadjgit-570d862ef3874e39a378a0268b120aeb02aa7718.zip
jgit-570d862ef3874e39a378a0268b120aeb02aa7718.tar.gz
jgit-570d862ef3874e39a378a0268b120aeb02aa7718.tar.bz2
Fix IOOBE in Repository.resolveSimple()refs/changes/64/4164/1
IndexOutOfBoundException is thrown from Repository.resolveSimple() when '-g' string is located less then 4 characters from the end of this string. Change-Id: I1128c2cdfec9db3023d4d0f1f40d863e84b75950 Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java
index b51a954..3a3e1c5 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java
@@ -597,7 +597,7 @@ public abstract class Repository {
return resolveAbbreviation(revstr);
int dashg = revstr.indexOf("-g");
- if (4 < revstr.length() && 0 <= dashg
+ if ((dashg + 4) < revstr.length() && 0 <= dashg
&& isHex(revstr.charAt(dashg + 2))
&& isHex(revstr.charAt(dashg + 3))
&& isAllHex(revstr, dashg + 4)) {