This is an automated email from the ASF dual-hosted git repository.

karan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git


The following commit(s) were added to refs/heads/master by this push:
     new f7f0f9fa168 use-safe (#18930)
f7f0f9fa168 is described below

commit f7f0f9fa168ba017c670491bd43d50c6909d4db5
Author: Zoltan Haindrich <[email protected]>
AuthorDate: Tue Jan 20 10:21:23 2026 +0100

    use-safe (#18930)
---
 .../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]

Reply via email to