commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] Commented: (COMPRESS-113) TarArchiveEntry.parseTarHeader() includes the trailing space/NUL when parsing the octal size
Date Tue, 01 Jun 2010 13:29:41 GMT

    [ https://issues.apache.org/jira/browse/COMPRESS-113?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12873995#action_12873995
] 

Sebb commented on COMPRESS-113:
-------------------------------

TarUtils.parseOctal() currently stops processing when it detects a non-leading space or null,
so "0777 7 " is not rejected.

It also ignores both leading '0' and spaces, so "0 0 0777 " is not rejected.

AFAICT, there is no format that allows embedded space or NUL, so it seems to me that these
should also be rejected.

Looks like there are several conventions for terminating numeric fields:

space,NUL - mode, uid, and gid
NUL, space - checksum
space - size and mtime; POSIX
NUL - POSIX

Maybe the most portable approach for parsing octal numbers would be to allow:
- leading spaces
- 1 or 2 trailing space or NUL characters.

> TarArchiveEntry.parseTarHeader() includes the trailing space/NUL when parsing the octal
size
> --------------------------------------------------------------------------------------------
>
>                 Key: COMPRESS-113
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-113
>             Project: Commons Compress
>          Issue Type: Bug
>    Affects Versions: 1.0
>            Reporter: Sebb
>             Fix For: 1.1
>
>
> TarArchiveEntry.parseTarHeader() includes the trailing space/NUL when parsing the octal
size.
> Although the size field in the header is 12 bytes, the last byte is supposed to be space
or NUL - i.e. only 11 octal digits are allowed for the size.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message