Fixed SubAck decoder remaining length bug

This commit is contained in:
selva.andre
2012-07-27 00:15:22 +02:00
parent 13c905ec48
commit c3176256dc
2 changed files with 25 additions and 2 deletions
@@ -29,9 +29,10 @@ public class SubAckDecoder extends MqttDecoder {
//MessageID
message.setMessageID(Utils.readWord(in));
remainingLength -= 2;
//Qos array
if (in.remaining() < remainingLength) {
if (in.remaining() < remainingLength ) {
return NEED_DATA;
}
for (int i = 0; i < remainingLength; i++) {