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
12891289
12901290 protected void _writeLengthPrefixed (byte [] data , int offset , int len ) throws IOException
12911291 {
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
12921295 int ptr = _writeTag (_currPtr );
12931296 ptr = ProtobufUtil .appendLengthLength (len , _currBuffer , ptr );
12941297
@@ -1783,7 +1786,7 @@ protected final void _ensureRoom(int needed) throws IOException
17831786
17841787 protected final void _ensureMore () throws IOException
17851788 {
1786- // if not, either simple (flush), or
1789+ // if not, either simple (flush), or
17871790 final int start = _currStart ;
17881791 final int currLen = _currPtr - start ;
17891792
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ public void testLongerStrings() throws Exception {
3131 ProtobufSchema schema = MAPPER .generateSchemaFor (p .getClass ());
3232 byte [] proto = MAPPER .writer (schema )
3333 .writeValueAsBytes (p );
34- assertEquals (13 , proto .length );
34+ assertEquals (2 * ( 7995 + 3 ) , proto .length );
3535
3636 TwoStrings result = MAPPER .readerFor (p .getClass ())
3737 .with (schema )
Original file line number Diff line number Diff line change @@ -20,3 +20,10 @@ Kenji Noguchi (knoguchi@github)
2020
2121* Reported #70 (protobuf), contributed fix: Can't deserialize packed repeated field
2222 (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:
1111
12122.9.0 (not yet released)
1313
14+ 2.8.9.1 (not yet released)
15+
16+ #94: Should _ensureRoom in ProtobufGenerator.writeString()
17+ (reported by marsqing@github)
18+
14192.8.9 (12-Jun-2017)
1520
1621#72: (protobuf) parser fails with /* comment */
You can’t perform that action at this time.
0 commit comments