Browse Source

yet another potential AIOBException in zip package

Bug found and fix provided by Earl Hood
master
Stefan Bodewig 10 years ago
parent
commit
99684cfd77
4 changed files with 11 additions and 1 deletions
  1. +1
    -0
      CONTRIBUTORS
  2. +5
    -0
      WHATSNEW
  3. +4
    -0
      contributors.xml
  4. +1
    -1
      src/main/org/apache/tools/zip/ZipOutputStream.java

+ 1
- 0
CONTRIBUTORS View File

@@ -109,6 +109,7 @@ Don Brown
Don Ferguson
Don Jeffery
Drew Sudell
Earl Hood
Edison Guo
Eduard Wirch
Edwin Woudt


+ 5
- 0
WHATSNEW View File

@@ -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:
--------------



+ 4
- 0
contributors.xml View File

@@ -463,6 +463,10 @@
<first>Drew</first>
<last>Sudell</last>
</name>
<name>
<first>Earl</first>
<last>Hood</last>
</name>
<name>
<first>Edison</first>
<last>Guo</last>


+ 1
- 1
src/main/org/apache/tools/zip/ZipOutputStream.java View File

@@ -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);


Loading…
Cancel
Save