1
1
mirror of https://github.com/wader/fq.git synced 2024-10-27 20:27:26 +03:00

Merge pull request #363 from wader/zip-correct-max-peek

zip: Correctly limit max EOCD find
This commit is contained in:
Mattias Wadman 2022-08-08 18:15:55 +02:00 committed by GitHub
commit fbe7bc9af6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -152,7 +152,7 @@ func zipDecode(d *decode.D, in any) any {
d.SeekAbs(d.Len())
// TODO: better EOCD probe
p, _, err := d.TryPeekFind(32, -8, -10000, func(v uint64) bool {
p, _, err := d.TryPeekFind(32, -8, 10000, func(v uint64) bool {
return v == uint64(endOfCentralDirectoryRecordSignatureN)
})
if err != nil {
@ -178,7 +178,7 @@ func zipDecode(d *decode.D, in any) any {
// there is a end of central directory locator, is zip64
if offsetCD == 0xff_ff_ff_ff {
p, _, err := d.TryPeekFind(32, -8, -10000, func(v uint64) bool {
p, _, err := d.TryPeekFind(32, -8, 10000, func(v uint64) bool {
return v == uint64(endOfCentralDirectoryLocatorSignatureN)
})
if err != nil {