This is an automated email from the ASF dual-hosted git repository. kgyrtkirk pushed a commit to branch 36.0.0 in repository https://gitbox.apache.org/repos/asf/druid.git
commit 23dc313485b02bddd21f0e04eecb29e6975956cc Author: Zoltan Haindrich <[email protected]> AuthorDate: Tue Jan 20 10:21:23 2026 +0100 use-safe (#18930) (cherry picked from commit f7f0f9fa168ba017c670491bd43d50c6909d4db5) --- .../src/main/java/org/apache/druid/client/cache/LZ4Transcoder.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/main/java/org/apache/druid/client/cache/LZ4Transcoder.java b/server/src/main/java/org/apache/druid/client/cache/LZ4Transcoder.java index 137a4ee130a..517a558a946 100644 --- a/server/src/main/java/org/apache/druid/client/cache/LZ4Transcoder.java +++ b/server/src/main/java/org/apache/druid/client/cache/LZ4Transcoder.java @@ -21,7 +21,7 @@ package org.apache.druid.client.cache; import net.jpountz.lz4.LZ4Compressor; import net.jpountz.lz4.LZ4Factory; -import net.jpountz.lz4.LZ4FastDecompressor; +import net.jpountz.lz4.LZ4SafeDecompressor; import net.spy.memcached.transcoders.SerializingTranscoder; import java.nio.ByteBuffer; @@ -66,12 +66,12 @@ public class LZ4Transcoder extends SerializingTranscoder { byte[] out = null; if (in != null) { - LZ4FastDecompressor decompressor = lz4Factory.fastDecompressor(); + LZ4SafeDecompressor decompressor = lz4Factory.safeDecompressor(); int size = ByteBuffer.wrap(in).getInt(); out = new byte[size]; - decompressor.decompress(in, Integer.BYTES, out, 0, out.length); + decompressor.decompress(in, Integer.BYTES, in.length - Integer.BYTES, out, 0, out.length); } return out == null ? null : out; } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
