mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-08 17:22:18 +00:00
Update i_system.c
Add a check for overflowing the TERIOS buffer
This commit is contained in:
parent
7643ffadbc
commit
2062553d22
1 changed files with 2 additions and 1 deletions
|
@ -607,6 +607,7 @@ void I_GetConsoleEvents(void)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ev.type = ev_console;
|
ev.type = ev_console;
|
||||||
|
ev.key = 0;
|
||||||
if (read(STDIN_FILENO, &key, 1) == -1 || !key)
|
if (read(STDIN_FILENO, &key, 1) == -1 || !key)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -633,7 +634,7 @@ void I_GetConsoleEvents(void)
|
||||||
}
|
}
|
||||||
else return;
|
else return;
|
||||||
}
|
}
|
||||||
else
|
else if (tty_con.cursor < sizeof (tty_con.buffer))
|
||||||
{
|
{
|
||||||
// push regular character
|
// push regular character
|
||||||
ev.key = tty_con.buffer[tty_con.cursor] = key;
|
ev.key = tty_con.buffer[tty_con.cursor] = key;
|
||||||
|
|
Loading…
Reference in a new issue