Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#3588 closed Bug (fixed)

Torrents with non power 2 pieceSizes fail hashchecks

Reported by: Longinus00 Owned by: Longinus00
Priority: Normal Milestone:
Component: Transmission Version: 2.04+
Severity: Blocker Keywords:
Cc:

Description

Transmission rejects many non power of 2 torrents but a 768KB piece size torrent is allowed by tr_getBlockSize and is not that uncommon.

buflen is set to MAX_BLOCK_SIZE in recalculateHash which can lead to false hashfails if any piece data is in the cache.

--- libtransmission/inout.c
+++ libtransmission/inout.c
@@ -289,7 +289,7 @@ recalculateHash( tr_torrent       * tor,
     size_t   bytesLeft;
     uint32_t offset = 0;
     tr_bool  success = TRUE;
-    const size_t buflen = MAX_BLOCK_SIZE;
+    const size_t buflen = tor->blockSize;
     void * buffer = tr_valloc( buflen );
     SHA_CTX  sha;
 

Change History (2)

comment:1 Changed 11 years ago by Longinus00

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in r11273.

comment:2 Changed 11 years ago by livings124

  • Milestone 2.10 deleted
Note: See TracTickets for help on using tickets.