From 2ddb52a655630e9aaaf2bb2292e21d2ab899798b Mon Sep 17 00:00:00 2001 From: Jeff Tung <100387939+jtung-apple@users.noreply.github.com> Date: Fri, 10 Feb 2023 12:41:53 -0800 Subject: [PATCH] [BUGFIX] SubscriptionResumptionStorage SubscriptionInfo SetEventPath and SetAttributePath tries to Calloc(0) (#24982) --- src/app/SubscriptionResumptionStorage.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/app/SubscriptionResumptionStorage.h b/src/app/SubscriptionResumptionStorage.h index 38a522fc445add..316adc3bd3c2e3 100644 --- a/src/app/SubscriptionResumptionStorage.h +++ b/src/app/SubscriptionResumptionStorage.h @@ -81,6 +81,10 @@ class SubscriptionResumptionStorage CHIP_ERROR SetAttributePaths(const ObjectList * pAttributePathList) { mAttributePaths.Free(); + if (!pAttributePathList) + { + return CHIP_NO_ERROR; + } const ObjectList * attributePath = pAttributePathList; size_t attributePathCount = 0; while (attributePath) @@ -102,6 +106,10 @@ class SubscriptionResumptionStorage CHIP_ERROR SetEventPaths(const ObjectList * pEventPathList) { mEventPaths.Free(); + if (!pEventPathList) + { + return CHIP_NO_ERROR; + } const ObjectList * eventPath = pEventPathList; size_t eventPathCount = 0; while (eventPath)