mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
Cbuf_Execute: do not change 'i' if it overflowed sizeof line.
Submitted by: Ozkan Sezer
This commit is contained in:
parent
a4d0d89720
commit
c0fac70763
1 changed files with 7 additions and 5 deletions
|
@ -202,11 +202,14 @@ Cbuf_Execute(void)
|
|||
|
||||
if (i > sizeof(line) - 1)
|
||||
{
|
||||
i = sizeof(line) - 1;
|
||||
memcpy(line, text, sizeof(line) - 1);
|
||||
line[sizeof(line) - 1] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(line, text, i);
|
||||
line[i] = 0;
|
||||
}
|
||||
|
||||
memcpy(line, text, i);
|
||||
line[i] = 0;
|
||||
|
||||
/* delete the text from the command buffer and move remaining
|
||||
commands down this is necessary because commands (exec,
|
||||
|
@ -215,7 +218,6 @@ Cbuf_Execute(void)
|
|||
{
|
||||
cmd_text.cursize = 0;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
i++;
|
||||
|
|
Loading…
Reference in a new issue