mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-22 09:11:21 +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;
|
||||
|
||||
ev.type = ev_console;
|
||||
ev.key = 0;
|
||||
if (read(STDIN_FILENO, &key, 1) == -1 || !key)
|
||||
return;
|
||||
|
||||
|
@ -633,7 +634,7 @@ void I_GetConsoleEvents(void)
|
|||
}
|
||||
else return;
|
||||
}
|
||||
else
|
||||
else if (tty_con.cursor < sizeof (tty_con.buffer))
|
||||
{
|
||||
// push regular character
|
||||
ev.key = tty_con.buffer[tty_con.cursor] = key;
|
||||
|
|
Loading…
Reference in a new issue