Skip to content

Commit

Permalink
Merge pull request #1 from yschimke/fix/inflator_failure
Browse files Browse the repository at this point in the history
Fix/inflator failure
  • Loading branch information
Fischiii authored Nov 26, 2024
2 parents 29be44f + d611e49 commit 3b56b8a
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 25 deletions.
5 changes: 5 additions & 0 deletions okhttp/src/main/kotlin/okhttp3/internal/ws/MessageInflater.kt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ class MessageInflater(
do {
inflaterSource.readOrInflate(buffer, Long.MAX_VALUE)
} while (inflater.bytesRead < totalBytesToRead && !inflater.finished())

if (noContextTakeover && inflater.bytesRead < totalBytesToRead) {
val left = totalBytesToRead - inflater.bytesRead
throw IOException("additional bytes ($left) after inflation")
}
}

@Throws(IOException::class)
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit 3b56b8a

Please sign in to comment.