valid msg

This commit is contained in:
yihaoDeng 2023-12-01 14:54:47 +08:00
parent 5a05f1019f
commit 58e84d86b2
1 changed files with 1 additions and 1 deletions

View File

@ -43,7 +43,7 @@ inline bool tmsgIsValid(tmsg_t type) {
static int8_t sz = sizeof(tMsgRangeDict) / sizeof(tMsgRangeDict[0]);
int segIdx = TMSG_SEG_CODE(type);
if (segIdx < sz) {
if (segIdx >= 0 && segIdx < sz) {
return type < tMsgRangeDict[segIdx];
}
return false;