torrent: avoid trying to fetch blocks past file

This commit is contained in:
qwx 2019-01-08 13:22:09 +01:00
parent d0f824edc2
commit 9f755671fb

View file

@ -811,7 +811,8 @@ Error:
}
}
}
havepiece(off / blocksize, w->str);
if(off < f->off + f->len)
havepiece(off / blocksize, w->str);
havepiece(f->off / blocksize, w->str);
close(fd);
exits(0);