forked from knolleary/pubsubclient
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve issue knolleary#832 (Potential memory corruption)
The memmove command is executed without any sanity checking on used values causing random reboots when an MQTT package gets processed with an impossible topic length. With a high rate test flow of MQTT messages this would sometimes corrupt memory after a few seconds. Extra sanity checks and calculation for payload_offset and message length have been implemented to better handle messages and prevent this memory corruption. Tested with a flow of about 50.000 messages per hour for multiple days. Went from hunderds of errors per hour til a few per day, the last errors mainly because the MQTT server couldn't keep up with the message flow. Never crashed again.
- Loading branch information
1 parent
2d228f2
commit c4a0dc0
Showing
2 changed files
with
82 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters