DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38563>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38563

           Summary: Tar target cannot add file with size > 2GB
           Product: Ant
           Version: 1.6.5
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: [EMAIL PROTECTED]


Hello:

While adding a file with size > 2GB in tar file using tar task of ant, I am 
getting exception similar to

“request to write '1024' bytes exceeds size in header of '-2147483648' bytes”

This is thrown at line 238 in TarOutputStream.

I looked into the code, and it seems the issue is related to downcasting of 
long value to int.

TarEntry reads the file size as long which is correct.
But when TarEntry is added into TarOutputStream (line 138), TarOutputStream 
downcasts file size value 
from long to int

line 167 in TarOutputStream is as follows
this.currSize = (int) entry.getSize();

This is incorrect, this way it will never allow to add file size > than 
2147483647 bytes i.e 2GB.
TarOutputStream should maintain entry size as long only.


Thanks
- Sagar

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

Reply via email to