diff --git a/src/main/java/com/beowulfe/hap/impl/connections/LengthPrefixedByteArrayProcessor.java b/src/main/java/com/beowulfe/hap/impl/connections/LengthPrefixedByteArrayProcessor.java index 11cbe6d91..10d456496 100644 --- a/src/main/java/com/beowulfe/hap/impl/connections/LengthPrefixedByteArrayProcessor.java +++ b/src/main/java/com/beowulfe/hap/impl/connections/LengthPrefixedByteArrayProcessor.java @@ -74,7 +74,7 @@ private void step(byte[] data, int pos, Collection results) { results.add(buffer.toByteArray()); buffer.reset(); targetLength = 0; - if (pos + toWrite > data.length) { + if (pos + toWrite < data.length) { step(data, pos + toWrite, results); } } else {