mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2026-07-30 09:44:26 +00:00
prvWriteMessageToBuffer wrote the first sbBYTES_TO_STORE_MESSAGE_LENGTH bytes of the size_t-typed length to the buffer as the data length. While this functions on little endian, it copies the wrong bytes on big endian. This fix converts the length to configMESSAGE_BUFFER_LENGTH_TYPE first, and then copies the exact amount, thus fixing the issue. Additionally it adds an assert to verify the size is not greater than the max value of configMESSAGE_BUFFER_LENGTH_TYPE; previously this would truncate silently. Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
52 KiB
52 KiB