!282 fix: 修复MagicKey数组越界访问

Merge pull request !282 from MGY917/master
This commit is contained in:
openharmony_ci 2021-06-03 11:52:17 +08:00 committed by Gitee
commit db38464778
1 changed files with 2 additions and 2 deletions

View File

@ -143,8 +143,8 @@ INT32 CheckMagicKey(CHAR key)
}
if (magicKeySwitch != 0) {
for (i = 0; g_magicOpTable[i] != NULL; ++i) {
if (key == g_magicOpTable[i]->magicKey) {
for (i = 0; i < MAGIC_KEY_NUM; i++) {
if (g_magicOpTable[i] != NULL && key == g_magicOpTable[i]->magicKey) {
(g_magicOpTable[i])->opHandler();
return 1;
}