mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-23 01:59:58 +00:00
Fix potential array out of bounds issue
Issue: #IB5M9I Signed-off-by: yanzhiqi1 <yanzhiqi1@huawei.com>
This commit is contained in:
parent
0095d534b3
commit
7d3eb85db2
@ -21,8 +21,7 @@
|
||||
#include "ecmascript/mem/mem.h"
|
||||
|
||||
namespace panda::ecmascript {
|
||||
static const int MAX_STACK_SIZE = 256;
|
||||
static const int FRAMES_LEN = 16;
|
||||
static const int MAX_STACK_SIZE = 16;
|
||||
|
||||
void Backtrace(std::ostringstream &stack, [[maybe_unused]] bool enableCache)
|
||||
{
|
||||
@ -35,7 +34,7 @@ void Backtrace(std::ostringstream &stack, [[maybe_unused]] bool enableCache)
|
||||
}
|
||||
|
||||
stack << "=====================Backtrace========================";
|
||||
for (int i = 0; i < FRAMES_LEN; ++i) {
|
||||
for (int i = 0; i < framesLen; ++i) {
|
||||
if (stackList[i] == nullptr) {
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user