summaryrefslogtreecommitdiff
path: root/src/DefaultBtProgressInfoFile.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/DefaultBtProgressInfoFile.cc')
-rw-r--r--src/DefaultBtProgressInfoFile.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/DefaultBtProgressInfoFile.cc b/src/DefaultBtProgressInfoFile.cc
index 7a5da1c3..b2161828 100644
--- a/src/DefaultBtProgressInfoFile.cc
+++ b/src/DefaultBtProgressInfoFile.cc
@@ -289,6 +289,10 @@ void DefaultBtProgressInfoFile::load()
pieceLength = ntohl(pieceLength);
}
+ if (pieceLength == 0) {
+ throw DL_ABORT_EX("piece length must not be 0");
+ }
+
uint64_t totalLength;
READ_CHECK(fp, &totalLength, sizeof(totalLength));
if (version >= 1) {