mirror of
https://github.com/espressif/openthread.git
synced 2026-08-15 15:17:46 +00:00
[network-diagnostic] avoid reference binding to null pointer (#4401)
This commit is contained in:
@@ -146,21 +146,21 @@ void NetworkDiagnostic::HandleDiagnosticGetResponse(void * aContex
|
||||
otError aResult)
|
||||
{
|
||||
static_cast<NetworkDiagnostic *>(aContext)->HandleDiagnosticGetResponse(
|
||||
*static_cast<Coap::Message *>(aMessage), *static_cast<const Ip6::MessageInfo *>(aMessageInfo), aResult);
|
||||
static_cast<Coap::Message *>(aMessage), static_cast<const Ip6::MessageInfo *>(aMessageInfo), aResult);
|
||||
}
|
||||
|
||||
void NetworkDiagnostic::HandleDiagnosticGetResponse(Coap::Message & aMessage,
|
||||
const Ip6::MessageInfo &aMessageInfo,
|
||||
void NetworkDiagnostic::HandleDiagnosticGetResponse(Coap::Message * aMessage,
|
||||
const Ip6::MessageInfo *aMessageInfo,
|
||||
otError aResult)
|
||||
{
|
||||
VerifyOrExit(aResult == OT_ERROR_NONE);
|
||||
VerifyOrExit(aMessage.GetCode() == OT_COAP_CODE_CHANGED);
|
||||
VerifyOrExit(aMessage && aMessage->GetCode() == OT_COAP_CODE_CHANGED);
|
||||
|
||||
otLogInfoNetDiag("Received diagnostic get response");
|
||||
|
||||
if (mReceiveDiagnosticGetCallback)
|
||||
{
|
||||
mReceiveDiagnosticGetCallback(&aMessage, &aMessageInfo, mReceiveDiagnosticGetCallbackContext);
|
||||
mReceiveDiagnosticGetCallback(aMessage, aMessageInfo, mReceiveDiagnosticGetCallbackContext);
|
||||
}
|
||||
|
||||
exit:
|
||||
|
||||
@@ -114,7 +114,7 @@ private:
|
||||
otMessage * aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
otError aResult);
|
||||
void HandleDiagnosticGetResponse(Coap::Message &aMessage, const Ip6::MessageInfo &aMessageInfo, otError aResult);
|
||||
void HandleDiagnosticGetResponse(Coap::Message *aMessage, const Ip6::MessageInfo *aMessageInfo, otError aResult);
|
||||
|
||||
static void HandleDiagnosticGetAnswer(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo);
|
||||
void HandleDiagnosticGetAnswer(Coap::Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
|
||||
|
||||
Reference in New Issue
Block a user