Author: peterreilly
Date: Tue Sep  5 12:47:56 2006
New Revision: 440461

URL: http://svn.apache.org/viewvc?view=rev&rev=440461
Log:
bugzilla: 40334 possible NPE in TarInputStream

Modified:
    ant/core/trunk/src/main/org/apache/tools/tar/TarInputStream.java

Modified: ant/core/trunk/src/main/org/apache/tools/tar/TarInputStream.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/tar/TarInputStream.java?view=diff&rev=440461&r1=440460&r2=440461
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/tar/TarInputStream.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/tar/TarInputStream.java Tue Sep  5 
12:47:56 2006
@@ -258,7 +258,11 @@
                 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) {



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to