mqtt: fixed wrong slice access

Slice access esults in rust panic when mqtt ping is processed
pull/5321/head
Ilya Bakhtin 5 years ago committed by Victor Julien
parent cc93638d33
commit c903441fe7

@ -628,7 +628,7 @@ pub fn parse_message(input: &[u8], protocol_version: u8, max_msg_size: usize) ->
_ => MQTTOperation::UNASSIGNED,
},
};
return Ok((&rem[skiplen+len..], msg));
return Ok((&input[skiplen+len..], msg));
}
MQTTTypeCode::DISCONNECT => match parse_disconnect(rem, len, protocol_version) {
Ok((_rem, disco)) => {

Loading…
Cancel
Save