From 3a16fe2c499f23b2bac75d53313a2f798684c083 Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Fri, 26 Jan 2024 23:18:36 -0800 Subject: [PATCH] Add reproduction of #473 (#478) --- .../dataformat/smile/async/NonBlockingByteArrayParser.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/smile/src/main/java/com/fasterxml/jackson/dataformat/smile/async/NonBlockingByteArrayParser.java b/smile/src/main/java/com/fasterxml/jackson/dataformat/smile/async/NonBlockingByteArrayParser.java index ce7f45115..1febd8d5b 100644 --- a/smile/src/main/java/com/fasterxml/jackson/dataformat/smile/async/NonBlockingByteArrayParser.java +++ b/smile/src/main/java/com/fasterxml/jackson/dataformat/smile/async/NonBlockingByteArrayParser.java @@ -1641,6 +1641,11 @@ private final String _decodeLongUnicodeName(byte[] inBuf, int inPtr, int len) th // note: caller ensures we have enough bytes available int outPtr = 0; char[] outBuf = _textBuffer.emptyAndGetCurrentSegment(); + // 26-Jan-2024, tatu: Must have enough space for all-ASCII, at least: + if (outBuf.length < (len + 8)) { + outBuf = _textBuffer.expandCurrentSegment(len + 8); + } + final int[] codes = SmileConstants.sUtf8UnitLengths; // since we only check expansion for multi-byte chars, there must be // enough room for remaining bytes as all-ASCII