Actions
Bug #9529
closedTarHeader (Gem::Package) doesn't parse size correctly for +8GB entries
Description
- The current TAR header parsing code assumes the size is represented as an octal string
- Because this is a 12-byte, null-terminated field, effectively this can represent up to 8GB (8^11).
- For bigger files the standard allows to define the field as a 12-byte INTEGER instead.
- When using this form, the first bit of the field should be turned on to signal that it is used.
Currently, TAR files containing files larger then 8GB in this format would fail parsing because size would be computed as 0.
(Wiki with some description of the logic, couldn't find a more "formal" document: http://en.wikipedia.org/wiki/Tar_(computing)#File_header)
The problem is with this code:
http://yard.ruby-doc.org/stdlib-2.1.0/Gem/Package/TarHeader.html#from-class_method
The line that assigns the value to size should be conditioned on the value of the first bit, and should treat the two cases differently
Actions
Like0
Like0Like0Like0