Closed nooj closed 2 years ago
Memory usage change @ c6a0904cb78aa326ea853cbc985bfdd630a1ae61
Board | flash | % | RAM for global variables | % |
---|---|---|---|---|
arduino:megaavr:uno2018 | 0 - 0 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
arduino:samd:mkr1000 | 0 - 0 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
arduino:samd:mkrwifi1010 | 0 - 0 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
arduino:samd:nano_33_iot | 0 - 0 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
PR #44 introduced a buffer overflow bug that will corrupt the heap if the transmit payload size is increased after any send. For an example of the bug, see below.
The patch included here will cause the existing tx payload buffer to be freed upon any call to
MqttClient::setTxPayloadSize()
. A subsequent call toMqttClient::write()
will allocate space using the new tx payload size (existing behavior). Data previously added to an outgoing message but not sent (viaMqttClient::endMessage()
) will be lost.Minimal example:
Output with
CORE_DEBUG_LEVEL=5