1
1
mirror of https://github.com/wader/fq.git synced 2024-11-24 03:05:22 +03:00

zip: Correctly limit max EOCD find

This commit is contained in:
Mattias Wadman 2022-08-08 18:04:48 +02:00
parent 414f64e84a
commit d607bee180

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 {