Fix a potential buffer overflow

This commit is contained in:
Yamagi Burmeister 2012-06-04 09:12:59 +02:00
parent 6c0df994f1
commit 9ec98a79d2

View file

@ -146,7 +146,10 @@ void Cbuf_Execute (void) {
if (text[i] == '\n')
break;
}
if( i > sizeof( line ) - 1 ) {
i = sizeof( line ) - 1;
}
memcpy (line, text, i);
line[i] = 0;