diff --git a/app/src/de/qspool/clementineremote/backend/ClementineSimpleConnection.java b/app/src/de/qspool/clementineremote/backend/ClementineSimpleConnection.java index 5e4fb2ac..c91a0c26 100644 --- a/app/src/de/qspool/clementineremote/backend/ClementineSimpleConnection.java +++ b/app/src/de/qspool/clementineremote/backend/ClementineSimpleConnection.java @@ -96,7 +96,8 @@ public ClementineMessage getProtoc() { // Read the data and return it mSocket.setSoTimeout(3000); int len = mIn.readInt(); - if (len < 0) { + // Check length. If it is less zero or more than 50mb it's very likely we got invalid data + if (len < 0 || len > 52428800) { throw new IOException("Invalid data length"); } byte[] data = new byte[len];