aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse/jgit/util
diff options
context:
space:
mode:
authorAndrey Loskutov <loskutov@gmx.de>2015-01-06 14:33:07 +0100
committerAndrey Loskutov <loskutov@gmx.de>2015-01-06 14:33:07 +0100
commit428d31efd305b08e83dbd9fdd895d18dc232c295 (patch)
treeba2328078dca307f4e0a3ac13ef2407ad352a4a2 /org.eclipse.jgit.test/tst/org/eclipse/jgit/util
parent79dacba9229e6c46e98e1f7d3912c3091e56da6a (diff)
downloadjgit-428d31efd305b08e83dbd9fdd895d18dc232c295.tar.gz
jgit-428d31efd305b08e83dbd9fdd895d18dc232c295.zip
AIOOB in ChangeIdUtil.indexOfChangeId if amended message is a newline
Bug: 456792 Change-Id: Idf38a0db7dc72d672ff185dcac2f41f0012a6673 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/util')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/util/ChangeIdUtilTest.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/ChangeIdUtilTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/ChangeIdUtilTest.java
index 66649b1006..7273cdbabc 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/ChangeIdUtilTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/ChangeIdUtilTest.java
@@ -639,6 +639,10 @@ public class ChangeIdUtilTest {
@Test
public void testIndexOfChangeId() {
+ assertEquals(-1, ChangeIdUtil.indexOfChangeId("", "\n"));
+ assertEquals(-1, ChangeIdUtil.indexOfChangeId("\n", "\n"));
+ assertEquals(-1, ChangeIdUtil.indexOfChangeId("\r\n", "\r\n"));
+
assertEquals(3, ChangeIdUtil.indexOfChangeId("x\n" + "\n"
+ "Change-Id: I3b7e4e16b503ce00f07ba6ad01d97a356dad7701\n",
"\n"));