Buggy code:
public class TarArchiveEntry implements ArchiveEntry , TarConstants { private String name ; private int mode ; private int userId ; private int groupId ; private long size ; private long modTime ; private byte linkFlag ; private String linkName ; private String magic ; private String version ; private String userName ; private String groupName ; private int devMajor ; private int devMinor ; private boolean isExtended ; private long realSize ; private File file ; public static final int MAX_NAMELEN = 31 ; public static final int DEFAULT_DIR_MODE = 16877 ; public static final int DEFAULT_FILE_MODE = 33188 ; public static final int MILLIS_PER_SECOND = 1000 ; private TarArchiveEntry ( ) { } public TarArchiveEntry ( String name ) { } public TarArchiveEntry ( String name , boolean preserveLeadingSlashes ) { } public TarArchiveEntry ( String name , byte linkFlag ) { } public TarArchiveEntry ( File file ) { } public TarArchiveEntry ( File file , String fileName ) { } public TarArchiveEntry ( byte [ ] headerBuf ) { } public boolean equals ( TarArchiveEntry it ) { } @ Override public boolean equals ( Object it ) { } @ Override public int hashCode ( ) { } public boolean isDescendent ( TarArchiveEntry desc ) { } public String getName ( ) { } public void setName ( String name ) { } public void setMode ( int mode ) { } public String getLinkName ( ) { } public void setLinkName ( String link ) { } public int getUserId ( ) { } public void setUserId ( int userId ) { } public int getGroupId ( ) { } public void setGroupId ( int groupId ) { } public String getUserName ( ) { } public void setUserName ( String userName ) { } public String getGroupName ( ) { } public void setGroupName ( String groupName ) { } public void setIds ( int userId , int groupId ) { } public void setNames ( String userName , String groupName ) { } public void setModTime ( long time ) { } public void setModTime ( Date time ) { } public Date getModTime ( ) { } public Date getLastModifiedDate ( ) { } public File getFile ( ) { } public int getMode ( ) { } public long getSize ( ) { } public void setSize ( long size ) { } public boolean isExtended ( ) { } public long getRealSize ( ) { } public boolean isGNUSparse ( ) { } public boolean isGNULongNameEntry ( ) { } public boolean isPaxHeader ( ) { } public boolean isGlobalPaxHeader ( ) { } public boolean isDirectory ( ) { } public boolean isFile ( ) { } public boolean isSymbolicLink ( ) { } public boolean isLink ( ) { } public boolean isCharacterDevice ( ) { } public boolean isBlockDevice ( ) { } public boolean isFIFO ( ) { } public TarArchiveEntry [ ] getDirectoryEntries ( ) { } public void writeEntryHeader ( byte [ ] outbuf ) { } public void parseTarHeader ( byte [ ] header ) { int offset = 0 ; name = TarUtils . parseName ( header , offset , NAMELEN ) ; offset += NAMELEN ; mode = ( ( int ) ( TarUtils . parseOctal ( header , offset , MODELEN ) ) ) ; offset += MODELEN ; userId = ( ( int ) ( TarUtils . parseOctal ( header , offset , UIDLEN ) ) ) ; offset += UIDLEN ; groupId = ( ( int ) ( TarUtils . parseOctal ( header , offset , GIDLEN ) ) ) ; offset += GIDLEN ; <START_BUG> size = TarUtils . parseOctal ( header , offset , SIZELEN ) ; <END_BUG> offset += SIZELEN ; modTime = TarUtils . parseOctal ( header , offset , MODTIMELEN ) ; offset += MODTIMELEN ; offset += CHKSUMLEN ; linkFlag = header [ ( offset ++ ) ] ; linkName = TarUtils . parseName ( header , offset , NAMELEN ) ; offset += NAMELEN ; magic = TarUtils . parseName ( header , offset , MAGICLEN ) ; offset += MAGICLEN ; version = TarUtils . parseName ( header , offset , VERSIONLEN ) ; offset += VERSIONLEN ; userName = TarUtils . parseName ( header , offset , UNAMELEN ) ; offset += UNAMELEN ; groupName = TarUtils . parseName ( header , offset , GNAMELEN ) ; offset += GNAMELEN ; devMajor = ( ( int ) ( TarUtils . parseOctal ( header , offset , DEVLEN ) ) ) ; offset += DEVLEN ; devMinor = ( ( int ) ( TarUtils . parseOctal ( header , offset , DEVLEN ) ) ) ; offset += DEVLEN ; int type = evaluateType ( header ) ; switch ( type ) { case FORMAT_OLDGNU : { offset += ATIMELEN_GNU ; offset += CTIMELEN_GNU ; offset += OFFSETLEN_GNU ; offset += LONGNAMESLEN_GNU ; offset += PAD2LEN_GNU ; offset += SPARSELEN_GNU ; isExtended = TarUtils . parseBoolean ( header , offset ) ; offset += ISEXTENDEDLEN_GNU ; realSize = TarUtils . parseOctal ( header , offset , REALSIZELEN_GNU ) ; offset += REALSIZELEN_GNU ; break ; } case FORMAT_POSIX : default : { String prefix = TarUtils . parseName ( header , offset , PREFIXLEN ) ; if ( ( isDirectory ( ) ) && ( ! ( name . endsWith ( "//" ) ) ) ) { name = ( name ) + "//" ; } if ( ( prefix . length ( ) ) > 0 ) { name = ( prefix + "//" ) + ( name ) ; } } } } private static String normalizeFileName ( String fileName , boolean preserveLeadingSlashes ) { } private int evaluateType ( byte [ ] header ) { } }

Fix:
size = TarUtils . parseOctalOrBinary ( header , offset , SIZELEN ) ;