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 +13
-1
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 +13
-1
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,12 @@ Project: jackson-dataformat-cbor
8
8
9
9
#14: Add support for dynamically changing `CBORGenerator.Feature`s
10
10
11
- 2.6.5 (not yet released)
11
+ 2.6.6 (not yet released)
12
+
13
+ #18: Correct parsing of zero length byte strings
14
+ (reported, fix suggested by philipa@github)
15
+
16
+ 2.6.5 (19-Jan-2016)
12
17
13
18
#15: CBORParser.getNumberType returns DOUBLE even if the generator has been fed with a float
14
19
(reported by Adrien G)
@@ -28,6 +33,7 @@ No changes since 2.6.2
28
33
29
34
No changes since 2.5
30
35
36
+ 2.5.5 (07-Dec-2015)
31
37
2.5.4 (09-Jun-2015)
32
38
2.5.3 (24-Apr-2015)
33
39
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