diff --git a/release-notes/VERSION b/release-notes/VERSION index 1d41330aa6..69679e274c 100644 --- a/release-notes/VERSION +++ b/release-notes/VERSION @@ -17,6 +17,8 @@ JSON library. 2.5.5 (not yet released) #220: Problem with `JsonParser.nextFieldName(SerializableString)` for byte-backed parser +#221: Fixed ArrayIndexOutOfBounds exception for character-based `JsonGenerator` + (reported by a-lerion@github) 2.5.4 (09-Jun-2015) diff --git a/src/main/java/com/fasterxml/jackson/core/json/UTF8JsonGenerator.java b/src/main/java/com/fasterxml/jackson/core/json/UTF8JsonGenerator.java index 6eba628e0e..6f34187222 100644 --- a/src/main/java/com/fasterxml/jackson/core/json/UTF8JsonGenerator.java +++ b/src/main/java/com/fasterxml/jackson/core/json/UTF8JsonGenerator.java @@ -5,7 +5,6 @@ import java.math.BigInteger; import com.fasterxml.jackson.core.*; -import com.fasterxml.jackson.core.JsonGenerator.Feature; import com.fasterxml.jackson.core.io.*; public class UTF8JsonGenerator diff --git a/src/main/java/com/fasterxml/jackson/core/json/WriterBasedJsonGenerator.java b/src/main/java/com/fasterxml/jackson/core/json/WriterBasedJsonGenerator.java index 25519972a3..0e8b6c596f 100644 --- a/src/main/java/com/fasterxml/jackson/core/json/WriterBasedJsonGenerator.java +++ b/src/main/java/com/fasterxml/jackson/core/json/WriterBasedJsonGenerator.java @@ -1813,7 +1813,7 @@ private void _appendCharacterEscape(char ch, int escCode) return; } if (escCode != CharacterEscapes.ESCAPE_CUSTOM) { // std, \\uXXXX - if ((_outputTail + 2) > _outputEnd) { + if ((_outputTail + 5) >= _outputEnd) { _flushBuffer(); } int ptr = _outputTail;