Skip to content

Commit be99e88

Browse files
committed
fix reading encrypted frames that don't line up with network frames
we want to call step again if there's remaining data. pos + toWrite is what we consumed from this network frame to complete the encrypted frame. so if it's less than the total network frame (data.length), then call step again.
1 parent dfc2d57 commit be99e88

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/beowulfe/hap/impl/connections/LengthPrefixedByteArrayProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private void step(byte[] data, int pos, Collection<byte[]> results) {
7474
results.add(buffer.toByteArray());
7575
buffer.reset();
7676
targetLength = 0;
77-
if (pos + toWrite > data.length) {
77+
if (pos + toWrite < data.length) {
7878
step(data, pos + toWrite, results);
7979
}
8080
} else {

0 commit comments

Comments
 (0)