Browse Source
Merge pull request #10475 from ameerj/microprofile-workaround
microprofile: Avoid crashing due to OOB stackPos
pull/15/merge
liamwhite
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
1 deletions
-
externals/microprofile/microprofile.h
|
|
|
@ -1697,7 +1697,13 @@ void MicroProfileFlip() |
|
|
|
{ |
|
|
|
int nTimer = MicroProfileLogTimerIndex(LE); |
|
|
|
uint8_t nGroup = pTimerToGroup[nTimer]; |
|
|
|
MP_ASSERT(nStackPos < MICROPROFILE_STACK_MAX); |
|
|
|
|
|
|
|
// To avoid crashing due to OOB memory accesses/asserts |
|
|
|
// simply skip this iteration |
|
|
|
// MP_ASSERT(nStackPos < MICROPROFILE_STACK_MAX); |
|
|
|
if (nStackPos >= MICROPROFILE_STACK_MAX) { |
|
|
|
break; |
|
|
|
} |
|
|
|
MP_ASSERT(nGroup < MICROPROFILE_MAX_GROUPS); |
|
|
|
pGroupStackPos[nGroup]++; |
|
|
|
pStack[nStackPos++] = k; |
|
|
|
|