File tree Expand file tree Collapse file tree 4 files changed +17
-2
lines changed
main/java/com/fasterxml/jackson/dataformat/protobuf
test/java/com/fasterxml/jackson/dataformat/protobuf/failing Expand file tree Collapse file tree 4 files changed +17
-2
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
@@ -1783,7 +1786,7 @@ protected final void _ensureRoom(int needed) throws IOException
1783
1786
1784
1787
protected final void _ensureMore () throws IOException
1785
1788
{
1786
- // if not, either simple (flush), or
1789
+ // if not, either simple (flush), or
1787
1790
final int start = _currStart ;
1788
1791
final int currLen = _currPtr - start ;
1789
1792
Original file line number Diff line number Diff line change @@ -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,3 +20,10 @@ Kenji Noguchi (knoguchi@github)
20
20
21
21
* Reported #70 (protobuf), contributed fix: Can't deserialize packed repeated field
22
22
(2.8.9)
23
+
24
+ marsqing@github
25
+
26
+ * Reported #85: (protobuf) _decode32Bits() bug in ProtobufParser
27
+ (2.8.9)
28
+ * Reported #94: (protobuf) Should _ensureRoom in ProtobufGenerator.writeString()
29
+ (2.8.10)
Original file line number Diff line number Diff line change @@ -11,6 +11,11 @@ Modules:
11
11
12
12
2.9.0 (not yet released)
13
13
14
+ 2.8.9.1 (not yet released)
15
+
16
+ #94: Should _ensureRoom in ProtobufGenerator.writeString()
17
+ (reported by marsqing@github)
18
+
14
19
2.8.9 (12-Jun-2017)
15
20
16
21
#72: (protobuf) parser fails with /* comment */
You can’t perform that action at this time.
0 commit comments