mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-25 00:02:47 +01:00
microprofile: Avoid crashing due to OOB stack pos
This commit is contained in:
parent
d6db422098
commit
fee91096ca
1 changed files with 7 additions and 1 deletions
8
externals/microprofile/microprofile.h
vendored
8
externals/microprofile/microprofile.h
vendored
|
@ -1697,7 +1697,13 @@ void MicroProfileFlip()
|
||||||
{
|
{
|
||||||
int nTimer = MicroProfileLogTimerIndex(LE);
|
int nTimer = MicroProfileLogTimerIndex(LE);
|
||||||
uint8_t nGroup = pTimerToGroup[nTimer];
|
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);
|
MP_ASSERT(nGroup < MICROPROFILE_MAX_GROUPS);
|
||||||
pGroupStackPos[nGroup]++;
|
pGroupStackPos[nGroup]++;
|
||||||
pStack[nStackPos++] = k;
|
pStack[nStackPos++] = k;
|
||||||
|
|
Loading…
Reference in a new issue