[ip6] fix static code analysis errors (#7422)

This commit fixes issues found during static code analysis.
This commit is contained in:
canisLupus1313
2022-02-16 10:57:37 -08:00
committed by GitHub
parent 2e03d4dfa1
commit 91e1d9cfa3
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -372,7 +372,7 @@ void DatasetManager::HandleGet(const Coap::Message &aMessage, const Ip6::Message
while (offset < aMessage.GetLength())
{
IgnoreError(aMessage.Read(offset, tlv));
SuccessOrExit(aMessage.Read(offset, tlv));
if (tlv.GetType() == Tlv::kGet)
{
+1 -1
View File
@@ -262,7 +262,7 @@ Error Ip6::InsertMplOption(Message &aMessage, Header &aHeader, MessageInfo &aMes
OptionMpl mplOption;
// read existing hop-by-hop option header
IgnoreError(aMessage.Read(0, hbh));
SuccessOrExit(error = aMessage.Read(0, hbh));
hbhLength = (hbh.GetLength() + 1) * 8;
VerifyOrExit(hbhLength <= aHeader.GetPayloadLength(), error = kErrorParse);