diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2019-10-02 10:59:34 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2019-10-02 11:01:39 +0200 |
commit | e59a17d7338a5b451f8fab872f7297be462bd2c0 (patch) | |
tree | e905a3178744c7f9ddec816303bc8898e950874e /org.eclipse.jgit | |
parent | 84022ac9de54ded6f04ca196264a8f2370e9da9a (diff) | |
parent | 3cb3ac95b250f20e13edc9a6cd62daa554387a4e (diff) | |
download | jgit-e59a17d7338a5b451f8fab872f7297be462bd2c0.tar.gz jgit-e59a17d7338a5b451f8fab872f7297be462bd2c0.zip |
Merge branch 'stable-5.2' into stable-5.3
* stable-5.2:
Prepare 5.1.13-SNAPSHOT builds
JGit v5.1.12.201910011832-r
Do not rely on ArrayIndexOutOfBoundsException to detect end of input
Change-Id: I3f11a83e177daefa0a2e91173f70f9547067f713
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java index 4726975d07..6ab5c149ff 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java @@ -1465,12 +1465,10 @@ public class Config { } int read() { - try { - return buf[pos++]; - } catch (ArrayIndexOutOfBoundsException e) { - pos = buf.length; + if (pos >= buf.length) { return -1; } + return buf[pos++]; } void reset() { |