mirror of
https://github.com/espressif/openthread.git
synced 2026-07-30 23:57:47 +00:00
[coap] fix header length calculation overflow error (#3260)
Credit to OSS-Fuzz.
This commit is contained in:
@@ -170,7 +170,7 @@ otError Header::FromMessage(const Message &aMessage, uint16_t aMetadataSize)
|
||||
VerifyOrExit(mHeaderLength + optionLength <= length);
|
||||
|
||||
aMessage.Read(offset, optionLength, mHeader.mBytes + mHeaderLength);
|
||||
mHeaderLength += static_cast<uint8_t>(optionLength);
|
||||
mHeaderLength += optionLength;
|
||||
offset += optionLength;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user