提交 071cd626 编写于 作者: G Guangyao Ma

fix: 修复MagicKey数组越界访问

closes #I3U4N9
Signed-off-by: NGuangyao Ma <guangyao.ma@outlook.com>
Change-Id: Ic4c4c7442cd381d03d2e40a51655a17299c4c250
上级 9b364500
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册