mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-25 14:57:20 +00:00
[client] app: prevent possible out of bounds array access
This commit is contained in:
parent
417c9cf092
commit
f59ef4422a
@ -345,7 +345,10 @@ void app_handleKeyPress(int sc, int charcode)
|
|||||||
if (sc == KEY_ESC)
|
if (sc == KEY_ESC)
|
||||||
app_setOverlay(false);
|
app_setOverlay(false);
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if (sc < sizeof(g_state.io->KeysDown))
|
||||||
g_state.io->KeysDown[sc] = true;
|
g_state.io->KeysDown[sc] = true;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -388,6 +391,7 @@ void app_handleKeyRelease(int sc, int charcode)
|
|||||||
|
|
||||||
if (app_isOverlayMode())
|
if (app_isOverlayMode())
|
||||||
{
|
{
|
||||||
|
if (sc < sizeof(g_state.io->KeysDown))
|
||||||
g_state.io->KeysDown[sc] = false;
|
g_state.io->KeysDown[sc] = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user