Index: TarArchiveInputStream.java
===================================================================
--- TarArchiveInputStream.java	(revision 1589918)
+++ TarArchiveInputStream.java	(working copy)
@@ -576,8 +576,10 @@
         if (currEntry == null) {
             throw new IllegalStateException("No current tar entry");
         }
+        
+        final int available = available();
 
-        numToRead = Math.min(numToRead, available());
+        numToRead = Math.min(numToRead, available);
         
         totalRead = is.read(buf, offset, numToRead);
         count(totalRead);
@@ -584,6 +586,10 @@
         
         if (totalRead == -1) {
             hasHitEOF = true;
+            if (available > 0)
+            {
+                throw new IOException("Unexpected EOF");
+            }
         } else {
             entryOffset += totalRead;
         }
