1
0
Fork 0

fix: prevent out-of-bounds trace datatype index

This commit is contained in:
MrAlaskan 2026-07-20 22:42:48 +08:00
parent 9b8beed836
commit 191b6eb7f8

View file

@ -147,7 +147,7 @@ static void findVariable(CO_trace_t *trace) {
/* third sequence: Output type */
dtIndex += ((*trace->format) >> 1) * 6;
if(dtIndex > (sizeof(dataTypes) / sizeof(CO_trace_dataType_t))) {
if(dtIndex >= (sizeof(dataTypes) / sizeof(CO_trace_dataType_t))) {
err = true;
}
}