Repository: ant Updated Branches: refs/heads/master a218020f1 -> 99684cfd7
yet another potential AIOBException in zip package Bug found and fix provided by Earl Hood Project: http://git-wip-us.apache.org/repos/asf/ant/repo Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/99684cfd Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/99684cfd Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/99684cfd Branch: refs/heads/master Commit: 99684cfd77a3851d098824e9eb871cd6c087934f Parents: a218020 Author: Stefan Bodewig <[email protected]> Authored: Tue Jul 21 06:02:50 2015 +0200 Committer: Stefan Bodewig <[email protected]> Committed: Tue Jul 21 06:04:23 2015 +0200 ---------------------------------------------------------------------- CONTRIBUTORS | 1 + WHATSNEW | 5 +++++ contributors.xml | 4 ++++ src/main/org/apache/tools/zip/ZipOutputStream.java | 2 +- 4 files changed, 11 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ant/blob/99684cfd/CONTRIBUTORS ---------------------------------------------------------------------- diff --git a/CONTRIBUTORS b/CONTRIBUTORS index e78bd62..a4b01e8 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -109,6 +109,7 @@ Don Brown Don Ferguson Don Jeffery Drew Sudell +Earl Hood Edison Guo Eduard Wirch Edwin Woudt http://git-wip-us.apache.org/repos/asf/ant/blob/99684cfd/WHATSNEW ---------------------------------------------------------------------- diff --git a/WHATSNEW b/WHATSNEW index 9fb1454..db8f88f 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -7,6 +7,11 @@ Changes that could break older environments: Fixed bugs: ----------- + * ZipOutputStream could cause an ArrayIndexOutOfBoundsException when + adding entries with comments. This never happens when using Ant as + a build tool but may affect users using Ant's zip package as a + library. + Other changes: -------------- http://git-wip-us.apache.org/repos/asf/ant/blob/99684cfd/contributors.xml ---------------------------------------------------------------------- diff --git a/contributors.xml b/contributors.xml index 7ea115e..3cdc06e 100644 --- a/contributors.xml +++ b/contributors.xml @@ -464,6 +464,10 @@ <last>Sudell</last> </name> <name> + <first>Earl</first> + <last>Hood</last> + </name> + <name> <first>Edison</first> <last>Guo</last> </name> http://git-wip-us.apache.org/repos/asf/ant/blob/99684cfd/src/main/org/apache/tools/zip/ZipOutputStream.java ---------------------------------------------------------------------- diff --git a/src/main/org/apache/tools/zip/ZipOutputStream.java b/src/main/org/apache/tools/zip/ZipOutputStream.java index 261c717..0b4f5f9 100644 --- a/src/main/org/apache/tools/zip/ZipOutputStream.java +++ b/src/main/org/apache/tools/zip/ZipOutputStream.java @@ -1258,7 +1258,7 @@ public class ZipOutputStream extends FilterOutputStream { int extraStart = CFH_FILENAME_OFFSET + nameLen; System.arraycopy(extra, 0, buf, extraStart, extra.length); - int commentStart = extraStart + commentLen; + int commentStart = extraStart + extra.length; // file comment System.arraycopy(commentB.array(), commentB.arrayOffset(), buf, commentStart, commentLen);
