Skip to content

Commit

Permalink
Add an assert to guard the FIXED_ENDPOINT_COUNT value (project-chip#2…
Browse files Browse the repository at this point in the history
…3121)

* Add an assert to guard the FIXED_ENDPOINT_COUNT value
  • Loading branch information
selissia authored Oct 12, 2022
1 parent e0821ad commit 26dab6c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/app/util/attribute-storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ void emberAfEndpointConfigure(void)
{
uint16_t ep;

static_assert(FIXED_ENDPOINT_COUNT <= std::numeric_limits<decltype(ep)>::max(),
"FIXED_ENDPOINT_COUNT must not exceed the size of the endpoint data type");

#if !defined(EMBER_SCRIPTED_TEST)
uint16_t fixedEndpoints[] = FIXED_ENDPOINT_ARRAY;
uint16_t fixedDeviceTypeListLengths[] = FIXED_DEVICE_TYPE_LENGTHS;
Expand Down

0 comments on commit 26dab6c

Please sign in to comment.