Browse Source

TarInputStream.read() never returns EOF: bugzilla 39924

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@441862 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 19 years ago
parent
commit
ef367e7ac7
4 changed files with 13 additions and 0 deletions
  1. +1
    -0
      CONTRIBUTORS
  2. +2
    -0
      WHATSNEW
  3. +4
    -0
      contributors.xml
  4. +6
    -0
      src/main/org/apache/tools/tar/TarBuffer.java

+ 1
- 0
CONTRIBUTORS View File

@@ -188,6 +188,7 @@ Paul Galbraith
Paulo Gaspar Paulo Gaspar
Peter B. West Peter B. West
Peter Donald Peter Donald
Peter Hulst
Peter Reilly Peter Reilly
Phillip Wells Phillip Wells
Pierre Delisle Pierre Delisle


+ 2
- 0
WHATSNEW View File

@@ -16,6 +16,8 @@ Fixed bugs:
* AntClassLoader did not isolate resources when isolate was set. Bugzilla report 38747. * AntClassLoader did not isolate resources when isolate was set. Bugzilla report 38747.
* Diagnostics broken when using java 1.4. Bugzilla report 40395. * Diagnostics broken when using java 1.4. Bugzilla report 40395.
* Exception reporting in <copy> was broken. Bugzilla report 40300. * Exception reporting in <copy> was broken. Bugzilla report 40300.
* Handling of corrupt tar files, TarInputStream.read() never returns EOF.
Bugzilla report 39924.


Other changes: Other changes:
-------------- --------------


+ 4
- 0
contributors.xml View File

@@ -747,6 +747,10 @@
<first>Peter</first> <first>Peter</first>
<last>Donald</last> <last>Donald</last>
</name> </name>
<name>
<first>Peter</first>
<last>Hulst</last>
</name>
<name> <name>
<first>Peter</first> <first>Peter</first>
<last>Reilly</last> <last>Reilly</last>


+ 6
- 0
src/main/org/apache/tools/tar/TarBuffer.java View File

@@ -271,6 +271,12 @@ public class TarBuffer {
// Thanks to 'Yohann.Roussel@alcatel.fr' for this fix. // Thanks to 'Yohann.Roussel@alcatel.fr' for this fix.
// //
if (numBytes == -1) { if (numBytes == -1) {
if (offset == 0) {
// Ensure that we do not read gigabytes of zeros
// for a corrupt tar file.
// See http://issues.apache.org/bugzilla/show_bug.cgi?id=39924
return false;
}
// However, just leaving the unread portion of the buffer dirty does // However, just leaving the unread portion of the buffer dirty does
// cause problems in some cases. This problem is described in // cause problems in some cases. This problem is described in
// http://issues.apache.org/bugzilla/show_bug.cgi?id=29877 // http://issues.apache.org/bugzilla/show_bug.cgi?id=29877


Loading…
Cancel
Save