mirror of
https://github.com/espressif/openthread.git
synced 2026-08-24 19:29:52 +00:00
[meshcop] add length check to steering data before checking bloom filter (#2222)
We found cases where the device hits a fault when we process steering data with length = 0. This check will prevent this from happening.
This commit is contained in:
committed by
Jonathan Hui
parent
572fd2c9e2
commit
a837af7f6a
@@ -562,7 +562,7 @@ public:
|
||||
* @retval FALSE If the TLV does not appear to be well-formed.
|
||||
*
|
||||
*/
|
||||
bool IsValid(void) const { return GetLength() <= sizeof(*this) - sizeof(Tlv); }
|
||||
bool IsValid(void) const { return ((GetLength() != 0) && (GetLength() <= sizeof(*this) - sizeof(Tlv))); }
|
||||
|
||||
/**
|
||||
* This method sets all bits in the Bloom Filter to zero.
|
||||
|
||||
Reference in New Issue
Block a user