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

2020-05-27 Thread Stefan Bodewig
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=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-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



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

2020-05-27 Thread Peter Lee
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  wrote:

> On 2020-05-26,  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-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
>
>


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

2020-05-26 Thread Stefan Bodewig
On 2020-05-26,  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-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org