Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow a limit to be set on the decompressed buffer size for ZlibDecod…
…ers (#9924) Motivation: It is impossible to know in advance how much memory will be needed to decompress a stream of bytes that was compressed using the DEFLATE algorithm. In theory, up to 1032 times the compressed size could be needed. For untrusted input, an attacker could exploit this to exhaust the memory pool. Modifications: ZlibDecoder and its subclasses now support an optional limit on the size of the decompressed buffer. By default, if the limit is reached, decompression stops and a DecompressionException is thrown. Behavior upon reaching the limit is modifiable by subclasses in case they desire something else. Result: The decompressed buffer can now be limited to a configurable size, thus mitigating the possibility of memory pool exhaustion.
- Loading branch information
Showing
8 changed files
with
245 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.