diff --git a/openAPI/src/main/kotlin/jetbrains/exodus/crypto/StreamCipherInputStream.kt b/openAPI/src/main/kotlin/jetbrains/exodus/crypto/StreamCipherInputStream.kt index f3114ff7d..9b55b0332 100644 --- a/openAPI/src/main/kotlin/jetbrains/exodus/crypto/StreamCipherInputStream.kt +++ b/openAPI/src/main/kotlin/jetbrains/exodus/crypto/StreamCipherInputStream.kt @@ -43,7 +43,7 @@ class StreamCipherInputStream(input: InputStream, private val cipherGetter: () - val b = bytes.notNull { "Can't read into null array" } val read = super.read(b, off, len) if (read > 0) { - for (i in off until read) { + for (i in off until read + off) { b[i] = cipher.crypt(b[i]) } position += read