Add test for batteries module, update deps

This commit is contained in:
eleksir
2024-09-23 00:20:06 +03:00
parent 4bff21f4c7
commit 7ce2d9d9ec
98 changed files with 3114 additions and 99 deletions

View File

@@ -137,7 +137,10 @@ func (p *bplistParser) parseSizedInteger(off offset, nbytes int) (lo uint64, hi
case 16:
lo, hi = binary.BigEndian.Uint64(p.buffer[off+8:]), binary.BigEndian.Uint64(p.buffer[off:])
default:
panic(errors.New("illegal integer size"))
if nbytes > 8 {
panic(errors.New("illegal integer size"))
}
lo, hi = binary.BigEndian.Uint64(p.buffer[off-(8-offset(nbytes)):]) & ((1<<offset(nbytes*8))-1), 0
}
newOffset = off + offset(nbytes)
return