[coap] return error if CoAP options exceeds message length (#3493)

This commit is contained in:
Jonathan Hui
2019-01-23 08:47:48 -08:00
committed by GitHub
parent 0c487ef140
commit 2a14819996
+2
View File
@@ -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;