mirror of
https://github.com/espressif/openthread.git
synced 2026-08-03 01:17:46 +00:00
[tlv] change GetSize() return type to uint16_t to avoid overflow (#2870)
Credit to OSS-Fuzz.
This commit is contained in:
@@ -104,7 +104,7 @@ public:
|
||||
* @returns The total size include Type, Length, and Value fields.
|
||||
*
|
||||
*/
|
||||
uint8_t GetSize(void) const { return sizeof(Tlv) + mLength; }
|
||||
uint16_t GetSize(void) const { return sizeof(Tlv) + mLength; }
|
||||
|
||||
/**
|
||||
* This method returns a pointer to the Value.
|
||||
|
||||
@@ -1336,7 +1336,7 @@ public:
|
||||
* @returns The total size of this entry (number of bytes).
|
||||
*
|
||||
*/
|
||||
uint8_t GetSize(void) const { return sizeof(ChannelMaskEntry) + mMaskLength; }
|
||||
uint16_t GetSize(void) const { return sizeof(ChannelMaskEntry) + mMaskLength; }
|
||||
|
||||
/**
|
||||
* This method clears the bit corresponding to @p aChannel in ChannelMask.
|
||||
|
||||
Reference in New Issue
Block a user