You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2025/08/19 12:12:00 UTC

[jira] [Updated] (COMPRESS-707) TAR: TarUtils.verifyCheckSum() throws an Exception when checksum could not be parsed

     [ https://issues.apache.org/jira/browse/COMPRESS-707?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary D. Gregory updated COMPRESS-707:
-------------------------------------
    Summary: TAR: TarUtils.verifyCheckSum() throws an Exception when checksum could not be parsed  (was: TAR: TarUtils.verifyCheckSum throws an Exception when checksum could not be parsed)

> TAR: TarUtils.verifyCheckSum() throws an Exception when checksum could not be parsed
> ------------------------------------------------------------------------------------
>
>                 Key: COMPRESS-707
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-707
>             Project: Commons Compress
>          Issue Type: Bug
>          Components: Archivers
>    Affects Versions: 1.27.1, 1.28.0
>            Reporter: Roel van Dijk
>            Priority: Major
>         Attachments: COMPRESS-707.tar
>
>
> When parsing a TAR entry, the checksum is read from the header and verified.
>  
> {code:java}
> final long storedSum = parseOctal(header, TarConstants.CHKSUM_OFFSET, TarConstants.CHKSUMLEN);
> {code}
> When the checksum itself is invalid (e.g. the octal number could not be parsed), an exception is thrown by the method TarUtils.parseOctal :
> {code:java}
> java.lang.IllegalArgumentException: Invalid byte 0 at offset 4 in '4712{NUL}36{NUL}' len=8 {code}
> This exception is non-descriptive, and in our opinion TarUtils.verifyCheckSum should just return false when the checksum could not be parsed.
> We will open a pull request on GitHub to address this. We will include an altered version of the bla.tar test file to cover this edge case.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)