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,6 +811,7 @@ Error:
} }
} }
} }
if(off < f->off + f->len)
havepiece(off / blocksize, w->str); havepiece(off / blocksize, w->str);
havepiece(f->off / blocksize, w->str); havepiece(f->off / blocksize, w->str);
close(fd); close(fd);