Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix prvWriteMessageToBuffer on big endian (#391)
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>
- Loading branch information