From b146766e3a485ffc860968673fe818c23a8bed93 Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Fri, 5 Apr 2024 11:18:41 -0700 Subject: [PATCH] [plat-utils] enhance `otMacFrameDoesAddrMatch()` (#9997) This commit updates `otMacFrameDoesAddrMatch()` to ensure it does not match if frame is malformed (`Frame::GetDstAddr()` fails). --- examples/platforms/utils/mac_frame.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/platforms/utils/mac_frame.cpp b/examples/platforms/utils/mac_frame.cpp index 0ae88db34..36a1c975c 100644 --- a/examples/platforms/utils/mac_frame.cpp +++ b/examples/platforms/utils/mac_frame.cpp @@ -43,7 +43,7 @@ bool otMacFrameDoesAddrMatch(const otRadioFrame *aFrame, Mac::Address dst; Mac::PanId panid; - SuccessOrExit(frame.GetDstAddr(dst)); + VerifyOrExit(frame.GetDstAddr(dst) == kErrorNone, rval = false); switch (dst.GetType()) {