mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-02-17 01:21:12 +00:00
Fix a potential buffer overflow
This commit is contained in:
parent
915eea8fef
commit
39677c1b0f
1 changed files with 4 additions and 1 deletions
|
@ -146,7 +146,10 @@ void Cbuf_Execute (void) {
|
||||||
if (text[i] == '\n')
|
if (text[i] == '\n')
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( i > sizeof( line ) - 1 ) {
|
||||||
|
i = sizeof( line ) - 1;
|
||||||
|
}
|
||||||
|
|
||||||
memcpy (line, text, i);
|
memcpy (line, text, i);
|
||||||
line[i] = 0;
|
line[i] = 0;
|
||||||
|
|
Loading…
Reference in a new issue