mirror of
https://github.com/espressif/openthread.git
synced 2026-08-05 18:37:45 +00:00
[mle] out-of-bounds read (OVERRUN) (#7214)
Fix issue after static code analyzer run. Signed-off-by: Marek Porwisz <[email protected]>
This commit is contained in:
@@ -4499,7 +4499,7 @@ const char *Mle::RoleToString(DeviceRole aRole)
|
||||
static_assert(kRoleRouter == 3, "kRoleRouter value is incorrect");
|
||||
static_assert(kRoleLeader == 4, "kRoleLeader value is incorrect");
|
||||
|
||||
return (aRole <= OT_ARRAY_LENGTH(kRoleStrings)) ? kRoleStrings[aRole] : "invalid";
|
||||
return (aRole < OT_ARRAY_LENGTH(kRoleStrings)) ? kRoleStrings[aRole] : "invalid";
|
||||
}
|
||||
|
||||
// LCOV_EXCL_START
|
||||
|
||||
Reference in New Issue
Block a user