Skip to content

Commit 55c48ca

Browse files
committed
Merge branch 'fix_incorrect_var' into 'main'
Use the correct variable in batter replacement description See merge request app-frameworks/esp-matter!659
2 parents d481fa9 + c58bc87 commit 55c48ca

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

components/esp_matter/esp_matter_attribute.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -3330,9 +3330,13 @@ namespace attribute {
33303330

33313331
attribute_t *create_active_locale(cluster_t *cluster, char *value, uint16_t length)
33323332
{
3333+
if (length > k_max_active_locale_length) {
3334+
ESP_LOGE(TAG, "Could not create attribute, string length out of bound");
3335+
return NULL;
3336+
}
33333337
return esp_matter::attribute::create(cluster, LocalizationConfiguration::Attributes::ActiveLocale::Id,
33343338
ATTRIBUTE_FLAG_WRITABLE | ATTRIBUTE_FLAG_NONVOLATILE,
3335-
esp_matter_char_str(value, length));
3339+
esp_matter_char_str(value, length), k_max_active_locale_length);
33363340
}
33373341

33383342
attribute_t *create_supported_locales(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count)
@@ -3854,7 +3858,7 @@ attribute_t *create_active_bat_faults(cluster_t *cluster, uint8_t * value, uint1
38543858

38553859
attribute_t *create_bat_replacement_description(cluster_t *cluster, const char * value, uint16_t length)
38563860
{
3857-
if (length > k_max_description_length) {
3861+
if (length > k_max_bat_replacement_description_length) {
38583862
ESP_LOGE(TAG, "Could not create attribute, string size out of bound");
38593863
return NULL;
38603864
}

0 commit comments

Comments
 (0)