Don't AIOOBE on bad announce reply

This commit is contained in:
zzz
2025-06-26 07:25:22 -04:00
parent 602fe2b9ca
commit 6eacc5e4db

View File

@ -553,7 +553,7 @@ class UDPTrackerClient implements I2PSessionMuxedListener {
Set<Hash> hashes;
if (peers > 0) {
hashes = new HashSet<Hash>(peers);
for (int off = 20; off < payload.length; off += Hash.HASH_LENGTH) {
for (int off = 20; off <= payload.length - Hash.HASH_LENGTH; off += Hash.HASH_LENGTH) {
hashes.add(Hash.create(payload, off));
}
} else {