quartiq / minimq

Minimal no_std MQTT v5.0 client implementation
MIT License
143 stars 16 forks source link

Handle bad length in header #155

Closed madmo closed 9 months ago

madmo commented 9 months ago

Prevents a panic in fn receive_buffer if a packet with a too big length is received.

madmo commented 9 months ago

It looks like this is protecting against an issue where the packet-header of the MQTT datagram may be corrupt and indicate a much larger size than we support, which we obviously should not use to index into self.buffer, so this is definitely a bug. Thanks for the fix here!

Can you please:

* [ ]  Add an entry to CHANGELOG.md indicating this defect has been fixed?

* [x]  Fix the style formatting?

Sure, updated the CHANGELOG. Thanks for reviewing!