Fix: Verify number of bytes contained in sessiond agent commands
[lttng-ust.git] / liblttng-ust-java-agent / java / lttng-ust-agent-common / org / lttng / ust / agent / client / LttngTcpSessiondClient.java
index 333dd5b02a7234256d1908499f0f6615a7c4a390..37f4ec4e59289c0f146d1766573af02e97254492 100644 (file)
@@ -374,7 +374,10 @@ public class LttngTcpSessiondClient implements Runnable {
                        return null;
                }
 
-               this.inFromSessiond.read(payload, 0, payload.length);
+               int read = inFromSessiond.read(payload, 0, payload.length);
+               if (read != payload.length) {
+                       throw new IOException("Unexpected number of bytes read in sessiond command payload");
+               }
                return payload;
        }
 
This page took 0.023492 seconds and 4 git commands to generate.