Browse Source

bugzilla: 40334 possible NPE in TarInputStream

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@440461 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 19 years ago
parent
commit
da87b9ec60
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      src/main/org/apache/tools/tar/TarInputStream.java

+ 5
- 1
src/main/org/apache/tools/tar/TarInputStream.java View File

@@ -258,7 +258,11 @@ public class TarInputStream extends FilterInputStream {
longName.append(new String(buf, 0, length));
}
getNextEntry();

if (this.currEntry == null) {
// Bugzilla: 40334
// Malformed tar file - long entry name not followed by entry
return null;
}
// remove trailing null terminator
if (longName.length() > 0
&& longName.charAt(longName.length() - 1) == 0) {


Loading…
Cancel
Save