Skip to content

Commit 5addf0f

Browse files
authored
Merge PR #465: Fixed bug in ZipAESStream.ReadBufferedData
copyCount was being computed but not passed to Array.Copy(), which caused an exception to be thrown when enough bytes were read from an encrypted stream.
1 parent 00ee653 commit 5addf0f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/ICSharpCode.SharpZipLib/Encryption/ZipAESStream.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ private int ReadBufferedData(byte[] buffer, int offset, int count)
163163
{
164164
int copyCount = Math.Min(count, _transformBufferFreePos - _transformBufferStartPos);
165165

166-
Array.Copy(_transformBuffer, _transformBufferStartPos, buffer, offset, count);
166+
Array.Copy(_transformBuffer, _transformBufferStartPos, buffer, offset, copyCount);
167167
_transformBufferStartPos += copyCount;
168168

169169
return copyCount;

0 commit comments

Comments
 (0)