diff --git a/module-ipc/src/main/java/io/izzel/taboolib/module/ipc/TabooIpcClientImpl.java b/module-ipc/src/main/java/io/izzel/taboolib/module/ipc/TabooIpcClientImpl.java index f984d8e..aec9ccb 100644 --- a/module-ipc/src/main/java/io/izzel/taboolib/module/ipc/TabooIpcClientImpl.java +++ b/module-ipc/src/main/java/io/izzel/taboolib/module/ipc/TabooIpcClientImpl.java @@ -52,7 +52,7 @@ public class TabooIpcClientImpl implements TabooIpcClient { public boolean readMessage(byte[] buf) { if (!available) throw new IllegalStateException(); if (this.block.getInt(16) == 2) { - this.block.getBytes(64, buf, 0, (int) this.block.getPayloadSize()); + this.block.getBytes(64, buf, 0, Math.min((int) this.block.getPayloadSize(), buf.length)); return this.block.compareAndSwapInt(16, 2, 0); } else return false; }