From ed13200ebf16bbf6bbd07b701745d2b4da75456f Mon Sep 17 00:00:00 2001 From: WangQixiang Date: Thu, 14 Jul 2022 16:57:47 +0800 Subject: [PATCH] Bugfix: Add check for attribute::set_val --- components/esp_matter/esp_matter_attribute_utils.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/esp_matter/esp_matter_attribute_utils.cpp b/components/esp_matter/esp_matter_attribute_utils.cpp index 69d691f5d..cb2ad462b 100644 --- a/components/esp_matter/esp_matter_attribute_utils.cpp +++ b/components/esp_matter/esp_matter_attribute_utils.cpp @@ -1035,6 +1035,9 @@ EmberAfStatus emberAfExternalAttributeWriteCallback(EndpointId endpoint_id, Clus } /* Update val */ + if (val.type == ESP_MATTER_VAL_TYPE_INVALID) { + return EMBER_ZCL_STATUS_FAILURE; + } attribute::set_val(attribute, &val); return EMBER_ZCL_STATUS_SUCCESS; }