I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 05c3b0d3 authored by zzz's avatar zzz
Browse files

Fix bug causing writes past end of file, introduced in refactoring, not in trunk

parent 854090e9
No related branches found
No related tags found
No related merge requests found
...@@ -971,7 +971,6 @@ public class Storage ...@@ -971,7 +971,6 @@ public class Storage
} }
int written = 0; int written = 0;
int off = 0;
int length = metainfo.getPieceLength(piece); int length = metainfo.getPieceLength(piece);
while (written < length) { while (written < length) {
int need = length - written; int need = length - written;
...@@ -995,12 +994,12 @@ public class Storage ...@@ -995,12 +994,12 @@ public class Storage
} }
raf.seek(start); raf.seek(start);
//rafs[i].write(bs, off + written, len); //rafs[i].write(bs, off + written, len);
pp.write(raf, off + written, len); pp.write(raf, written, len);
} }
written += len; written += len;
if (need - len > 0) { if (need - len > 0) {
i++; i++;
raflen = tf.length; raflen = _torrentFiles.get(i).length;
start = 0; start = 0;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment