This repository was archived by the owner on Jan 22, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed
main/java/com/fasterxml/jackson/dataformat/cbor
test/java/com/fasterxml/jackson/dataformat/cbor Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,11 @@ Project: jackson-dataformat-cbor
4
4
=== Releases ===
5
5
------------------------------------------------------------------------
6
6
7
+ 2.6.6 (not yet released)
8
+
9
+ #18: Correct parsing of zero length byte strings
10
+ (reported, fix suggested by philipa@github)
11
+
7
12
2.6.5 (19-Jan-2016)
8
13
9
14
#15: CBORParser.getNumberType returns DOUBLE even if the generator has been fed with a float
@@ -24,6 +29,7 @@ No changes since 2.6.2
24
29
25
30
No changes since 2.5
26
31
32
+ 2.5.5 (07-Dec-2015)
27
33
2.5.4 (09-Jun-2015)
28
34
2.5.3 (24-Apr-2015)
29
35
2.5.2 (29-Mar-2015)
Original file line number Diff line number Diff line change 17
17
18
18
public final class CBORParser extends ParserMinimalBase
19
19
{
20
+ private final static byte [] NO_BYTES = new byte [0 ];
21
+
20
22
/**
21
23
* Enumeration that defines all togglable features for CBOR generators.
22
24
*/
@@ -2078,6 +2080,9 @@ protected byte[] _finishBytes(int len) throws IOException
2078
2080
{
2079
2081
// First, simple: non-chunked
2080
2082
if (len >= 0 ) {
2083
+ if (len == 0 ) {
2084
+ return NO_BYTES ;
2085
+ }
2081
2086
byte [] b = new byte [len ];
2082
2087
if (_inputPtr >= _inputEnd ) {
2083
2088
loadMoreGuaranteed ();
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ public Bytes() { }
20
20
private final ObjectMapper MAPPER = cborMapper ();
21
21
22
22
public void testSmallBinaryValues () throws Exception {
23
+ _testBinary (0 );
23
24
_testBinary (1 );
24
25
_testBinary (20 );
25
26
_testBinary (100 );
You can’t perform that action at this time.
0 commit comments