File tree 2 files changed +6
-0
lines changed
src/main/java/com/fasterxml/jackson/core/util
2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ JSON library.
24
24
#630 : Add `StreamWriteCapability` for further format-based/format-agnostic
25
25
handling improvements
26
26
#631 : Add `JsonParser.getNumberValueExact()` to allow precision-retaining buffering
27
+ #639 : Limit initial allocated block size by `ByteArrayBuilder` to max block size
27
28
- Deprecate `JsonParser .getCurrentTokenId ()` (use `#currentTokenId ()` instead)
28
29
29
30
2.11 .2 (02 - Aug - 2020 )
Original file line number Diff line number Diff line change @@ -54,6 +54,11 @@ public final class ByteArrayBuilder extends OutputStream
54
54
55
55
public ByteArrayBuilder (BufferRecycler br , int firstBlockSize ) {
56
56
_bufferRecycler = br ;
57
+ // 04-Sep-2020, tatu: Let's make this bit more robust and refuse to allocate
58
+ // humongous blocks even if requested
59
+ if (firstBlockSize > MAX_BLOCK_SIZE ) {
60
+ firstBlockSize = MAX_BLOCK_SIZE ;
61
+ }
57
62
_currBlock = (br == null ) ? new byte [firstBlockSize ] : br .allocByteBuffer (BufferRecycler .BYTE_WRITE_CONCAT_BUFFER );
58
63
}
59
64
You can’t perform that action at this time.
0 commit comments