fixed parsing issue and added test

This commit is contained in:
Jan Eggers
2018-06-29 13:37:26 +02:00
parent bf8dae67de
commit 8574bbb64f
4 changed files with 88 additions and 0 deletions
@@ -26,6 +26,11 @@ namespace MQTTnet.AspNetCore
return false;
}
if (copy.Length < bodyLength)
{
return false;
}
var bodySlice = copy.Slice(0, bodyLength);
packet = serializer.Deserialize(new ReceivedMqttPacket(fixedheader, new MqttPacketBodyReader(bodySlice.GetArray(), 0)));
consumed = bodySlice.End;