Update ipc module.

master
IzzelAliz 2019-12-04 23:05:56 +08:00
parent 962bfa5256
commit 5cb7dfa92a
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}