mirror of
https://github.com/espressif/openthread.git
synced 2026-08-09 20:27:47 +00:00
[coap] return error if CoAP options exceeds message length (#3493)
This commit is contained in:
@@ -271,6 +271,8 @@ const otCoapOption *Message::GetNextOption(void)
|
||||
ExitNow();
|
||||
}
|
||||
|
||||
VerifyOrExit(optionLength <= GetLength() - GetHelpData().mNextOptionOffset, error = OT_ERROR_PARSE);
|
||||
|
||||
rval = &GetHelpData().mOption;
|
||||
rval->mNumber += optionDelta;
|
||||
rval->mLength = optionLength;
|
||||
|
||||
Reference in New Issue
Block a user