mirror of
https://github.com/espressif/openthread.git
synced 2026-08-08 03:37:46 +00:00
[mac-frame] return parse error in GetKeyId() (#6281)
This commit is contained in:
@@ -564,7 +564,7 @@ Error Frame::GetKeyId(uint8_t &aKeyId) const
|
||||
uint8_t keySourceLength;
|
||||
uint8_t index = FindSecurityHeaderIndex();
|
||||
|
||||
VerifyOrExit(index != kInvalidIndex);
|
||||
VerifyOrExit(index != kInvalidIndex, error = kErrorParse);
|
||||
|
||||
keySourceLength = GetKeySourceLength(mPsdu[index] & kKeyIdModeMask);
|
||||
|
||||
@@ -590,6 +590,7 @@ Error Frame::GetCommandId(uint8_t &aCommandId) const
|
||||
{
|
||||
Error error = kErrorNone;
|
||||
uint8_t index = FindPayloadIndex();
|
||||
|
||||
VerifyOrExit(index != kInvalidIndex, error = kErrorParse);
|
||||
|
||||
aCommandId = mPsdu[IsVersion2015() ? index : (index - 1)];
|
||||
|
||||
Reference in New Issue
Block a user