Skip to content

Commit 772b2ae

Browse files
committed
KTOR-7075: clear buffer before reading from decompressed stream
1 parent 665de34 commit 772b2ae

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ktor-utils/jvm/src/io/ktor/util/ZstdEncoding.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ private suspend fun ByteReadChannel.decodeTo(
7171
try {
7272
var decompressedBytesCount: Int
7373
do {
74+
buf.clear()
7475
decompressedBytesCount = zstdStream.read(buf.array())
7576

7677
if (decompressedBytesCount > 0) {

0 commit comments

Comments
 (0)