Skip to content
This repository was archived by the owner on Jan 22, 2019. It is now read-only.

Commit a1432ca

Browse files
committed
Merge branch '2.6'
Conflicts: pom.xml release-notes/VERSION
2 parents 32b3648 + 17a63ad commit a1432ca

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

release-notes/VERSION

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ Project: jackson-dataformat-cbor
88

99
#14: Add support for dynamically changing `CBORGenerator.Feature`s
1010

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)
1217

1318
#15: CBORParser.getNumberType returns DOUBLE even if the generator has been fed with a float
1419
(reported by Adrien G)
@@ -28,6 +33,7 @@ No changes since 2.6.2
2833

2934
No changes since 2.5
3035

36+
2.5.5 (07-Dec-2015)
3137
2.5.4 (09-Jun-2015)
3238
2.5.3 (24-Apr-2015)
3339
2.5.2 (29-Mar-2015)

src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
public final class CBORParser extends ParserMinimalBase
1919
{
20+
private final static byte[] NO_BYTES = new byte[0];
21+
2022
/**
2123
* Enumeration that defines all togglable features for CBOR generators.
2224
*/
@@ -2078,6 +2080,9 @@ protected byte[] _finishBytes(int len) throws IOException
20782080
{
20792081
// First, simple: non-chunked
20802082
if (len >= 0) {
2083+
if (len == 0) {
2084+
return NO_BYTES;
2085+
}
20812086
byte[] b = new byte[len];
20822087
if (_inputPtr >= _inputEnd) {
20832088
loadMoreGuaranteed();

src/test/java/com/fasterxml/jackson/dataformat/cbor/ParserBinaryTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public Bytes() { }
2020
private final ObjectMapper MAPPER = cborMapper();
2121

2222
public void testSmallBinaryValues() throws Exception {
23+
_testBinary(0);
2324
_testBinary(1);
2425
_testBinary(20);
2526
_testBinary(100);

0 commit comments

Comments
 (0)