File tree Expand file tree Collapse file tree 4 files changed +18
-3
lines changed
main/java/com/fasterxml/jackson/dataformat/protobuf
test/java/com/fasterxml/jackson/dataformat/protobuf Expand file tree Collapse file tree 4 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -1289,6 +1289,9 @@ protected void _encodeLongerString(String text) throws IOException
1289
1289
1290
1290
protected void _writeLengthPrefixed (byte [] data , int offset , int len ) throws IOException
1291
1291
{
1292
+ // 15-Jun-2017, tatu: [dataformats-binary#94]: need to ensure there is actually
1293
+ // enough space for simple add; if not, need more checking
1294
+ _ensureRoom (10 ); // max tag 5 bytes, ditto max length
1292
1295
int ptr = _writeTag (_currPtr );
1293
1296
ptr = ProtobufUtil .appendLengthLength (len , _currBuffer , ptr );
1294
1297
@@ -1781,7 +1784,7 @@ protected final void _ensureRoom(int needed) throws IOException
1781
1784
1782
1785
protected final void _ensureMore () throws IOException
1783
1786
{
1784
- // if not, either simple (flush), or
1787
+ // if not, either simple (flush), or
1785
1788
final int start = _currStart ;
1786
1789
final int currLen = _currPtr - start ;
1787
1790
Original file line number Diff line number Diff line change 1
- package com .fasterxml .jackson .dataformat .protobuf . failing ;
1
+ package com .fasterxml .jackson .dataformat .protobuf ;
2
2
3
3
import com .fasterxml .jackson .annotation .JsonPropertyOrder ;
4
4
@@ -31,7 +31,7 @@ public void testLongerStrings() throws Exception {
31
31
ProtobufSchema schema = MAPPER .generateSchemaFor (p .getClass ());
32
32
byte [] proto = MAPPER .writer (schema )
33
33
.writeValueAsBytes (p );
34
- assertEquals (13 , proto .length );
34
+ assertEquals (2 * ( 7995 + 3 ) , proto .length );
35
35
36
36
TwoStrings result = MAPPER .readerFor (p .getClass ())
37
37
.with (schema )
Original file line number Diff line number Diff line change @@ -20,6 +20,13 @@ Kenji Noguchi (knoguchi@github)
20
20
* Reported #70 (protobuf), contributed fix: Can't deserialize packed repeated field
21
21
(2.8.9)
22
22
23
+ marsqing@github
24
+
25
+ * Reported #85: (protobuf) _decode32Bits() bug in ProtobufParser
26
+ (2.8.9)
27
+ * Reported #94: (protobuf) Should _ensureRoom in ProtobufGenerator.writeString()
28
+ (2.8.10)
29
+
23
30
baharclerode@github:
24
31
25
32
* Contributed #14 (avro): Add support for Avro annotations via `AvroAnnotationIntrospector`
Original file line number Diff line number Diff line change @@ -30,6 +30,11 @@ Modules:
30
30
#79 (proto): Fix wire type for packed arrays
31
31
- [avro] Upgrade `avro-core` dep from 1.7.7 to 1.8.1
32
32
33
+ 2.8.9.1 (not yet released)
34
+
35
+ #94: Should _ensureRoom in ProtobufGenerator.writeString()
36
+ (reported by marsqing@github)
37
+
33
38
2.8.9 (12-Jun-2017)
34
39
35
40
#72: (protobuf) parser fails with /* comment */
You can’t perform that action at this time.
0 commit comments