Files
spring-boot/core
Sumit Kumar Das fc6acdbc21 Reset cached AppendableByteArray before it is reused
AppendableByteArray.reset() was only called from toByteArray(), so an
encode that failed part-way left its partial output in the thread-local
cached instance. The next value encoded on that thread was then prefixed
with it, which in structured logging corrupted the log event following a
failed one.

Reset the cached instance when it is handed out instead, so the buffer
is clean regardless of how the previous use ended. This also covers the
early return in toByteArray() for empty content, which returns without
resetting.

See gh-51156

Signed-off-by: Sumit Kumar Das <skdas5405@gmail.com>
2026-08-11 17:59:20 +02:00
..