Bug 222036

Summary: Data corruption when downloading additional files
Product: [Applications] ktorrent Reporter: Peter Klotz <peter.klotz99>
Component: generalAssignee: Joris Guisson <joris.guisson>
Status: VERIFIED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Peter Klotz 2010-01-10 11:50:00 UTC
Version:           3.2.4 (using KDE 4.3.2)
Compiler:          gcc 4.4.1 
OS:                Linux
Installed from:    Ubuntu Packages

This bug can be reproduced very easily, at least in KTorrent 3.2.4 amd64.

Use this torrent containing two files for example:

http://torrent.fedoraproject.org/torrents/Fedora-12-x86_64-Live.torrent

Add the torrent but select no files to download. After adding, navigate to the "Files" section and add the file "Fedora-12-x86_64-CHECKSUM" manually for download.

KTorrent starts downloading the corresponding 256kB chunk and finishes. However "Fedora-12-x86_64-CHECKSUM" ends up having 262144 Bytes (the whole chunk) instead of only 1525 Bytes. It seems that the checksum file is padded with a part of the ISO image that is also contained in the torrent.

The "Check Data" option does not find any errors.

I tried compiling KTorrent 3.3.2 but was unable to manually add files there. Maybe someone can check if this problem still persists.
Comment 1 Joris Guisson 2010-01-11 18:35:05 UTC
SVN commit 1073135 by guisson:

Fix bug causing files to be created which are to big in some rare circumstances

BUG: 222036

 M  +1 -0      ChangeLog  
 M  +6 -2      libbtcore/diskio/multifilecache.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1073135
Comment 2 Peter Klotz 2010-07-23 21:26:43 UTC
I can confirm that the bug is fixed in KTorrent 3.3.4 (Ubuntu 10.04 amd64).