diff --git a/CONTRIBUTORS b/CONTRIBUTORS index b3ed9ffe6..f37e80bf8 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -274,7 +274,6 @@ Steven E. Newton Takashi Okamoto Taoufik Romdhane Tariq Master -Trejkaz Xaoza Thomas Aglassinger Thomas Butz Thomas Christen @@ -283,13 +282,15 @@ Thomas Haas Thomas Quas Tim Drury Tim Fennell -Timothy Gerard Endres Tim Stephenson +Timothy Gerard Endres Tom Ball Tom Brus Tom Cunningham Tom Dimock Tom Eugelink +Tom May +Trejkaz Xaoza Ulrich Schmidt Victor Toni Vincent Legoll diff --git a/WHATSNEW b/WHATSNEW index ed93d30aa..75eb16054 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -56,7 +56,7 @@ Changes that could break older environments: * CBZip2InputStream will now throw an IOException if passed in a null or empty InputStream to read from. - Bugzilla Report 32200 + Bugzilla Reports 32200. * will now fail when trying to extract certain broken archives that would have been silently ignored in earlier version. @@ -166,9 +166,9 @@ Fixed bugs: * CBZip2OutputStream threw an exception if it was closed prior to writing anything. - Bugzilla Report 32200 + Bugzilla Reports 32200, 45836 - * The IPlanetDeploymentToll didn't use the configured DTD locations. + * The IPlanetDeploymentTool didn't use the configured DTD locations. Bugzilla Report 31876. * The ant shell script printed a warning unser Cygwin if JAVA_HOME diff --git a/contributors.xml b/contributors.xml index 4f9d3993d..0862edcaa 100644 --- a/contributors.xml +++ b/contributors.xml @@ -1167,6 +1167,10 @@ Tom Eugelink + + Tom + May + Trejkaz Xaoz diff --git a/src/main/org/apache/tools/bzip2/CBZip2OutputStream.java b/src/main/org/apache/tools/bzip2/CBZip2OutputStream.java index 98c0a2300..bb01eb4ac 100644 --- a/src/main/org/apache/tools/bzip2/CBZip2OutputStream.java +++ b/src/main/org/apache/tools/bzip2/CBZip2OutputStream.java @@ -434,6 +434,12 @@ public class CBZip2OutputStream extends OutputStream implements BZip2Constants { combinedCRC = (combinedCRC << 1) | (combinedCRC >>> 31); combinedCRC ^= blockCRC; + // If the stream was empty we must skip the rest of this method. + // See bug#32200. + if (last == -1) { + return; + } + /* sort the block and establish posn of original string */ doReversibleTransformation(); @@ -1131,15 +1137,7 @@ public class CBZip2OutputStream extends OutputStream implements BZip2Constants { */ // if (verbosity >= 4) fprintf ( stderr, " sort initialise ...\n" ); - - // set last to zero in case it's never been set before - // see bug#32200, initBlock is the real culprit - // setting last to -1, but not sure if this -1 is important - // in normal scheme - if (last < 0) { - last = 0; - } - + for (i = 0; i < NUM_OVERSHOOT_BYTES; i++) { block[last + i + 2] = block[(i % (last + 1)) + 1]; }