You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Stefan Bodewig <bo...@apache.org> on 2020/05/26 15:54:18 UTC

Re: [commons-compress] branch master updated: COMPRESS-530 : skip non-number when parsing pax header

On 2020-05-26, <pe...@apache.org> wrote:

>+                // COMPRESS-530 : skip non-number chars
>+                if (ch < '0' || ch > '9') {
>+                    continue;
>+                }

if this ever happens, doesn't that mean the PAX header is malformed? In
that case may it be better to throw an IOException?

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [commons-compress] branch master updated: COMPRESS-530 : skip non-number when parsing pax header

Posted by Stefan Bodewig <bo...@apache.org>.
On 2020-05-27, Peter Lee wrote:

> Did some googles, can't find too much but  this :
> https://www.systutorials.com/docs/linux/man/5-star/
> And it says :
>> Each record starts with a a decimal length field. The length includes the
>> total size of a record including the length field itself and the trailing
>> new line.

For some reason I always end up in either GNU tar's info or the FreeBDS
man page :-). In this case

https://www.freebsd.org/cgi/man.cgi?query=tar&sektion=5

see "Pax Interchange Format"

,----
| The extended attributes themselves are stored as a series of text-format
| lines encoded in the portable UTF-8 encoding. Each line consists of a
| decimal number, a space, a key string, an equals sign, a value string,
| and a new line.
`----

> Seems we should throw a exception.

+1 - likely an IOException.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [commons-compress] branch master updated: COMPRESS-530 : skip non-number when parsing pax header

Posted by Peter Lee <pe...@gmail.com>.
Did some googles, can't find too much but  this :
https://www.systutorials.com/docs/linux/man/5-star/
And it says :
> Each record starts with a a decimal length field. The length includes the
total size of a record including the length field itself and the trailing
new line.
Seems we should throw a exception. Will modify the code.

On Tue, May 26, 2020 at 11:54 PM Stefan Bodewig <bo...@apache.org> wrote:

> On 2020-05-26, <pe...@apache.org> wrote:
>
> >+                // COMPRESS-530 : skip non-number chars
> >+                if (ch < '0' || ch > '9') {
> >+                    continue;
> >+                }
>
> if this ever happens, doesn't that mean the PAX header is malformed? In
> that case may it be better to throw an IOException?
>
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>