소스 검색

Fix IOOBE in Repository.resolveSimple()

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>
tags/v1.2.0.201112221803-r
Dariusz Luksza 12 년 전
부모
커밋
570d862ef3
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1
    1
      org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java

+ 1
- 1
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)) {

Loading…
취소
저장