2
0
mirror of synced 2025-02-23 22:28:11 +00:00

Off by one error in torrent.pieceLength?

This commit is contained in:
Matt Joiner 2016-02-21 17:25:47 +11:00
parent 380dc7a2b4
commit 61af11fddc

View File

@ -655,7 +655,7 @@ type Peer struct {
}
func (t *torrent) pieceLength(piece int) (len_ pp.Integer) {
if piece < 0 || piece > t.Info.NumPieces() {
if piece < 0 || piece >= t.Info.NumPieces() {
return
}
if int(piece) == t.numPieces()-1 {