Fix a potential buffer overflow

This commit is contained in:
Yamagi Burmeister 2012-06-04 09:12:59 +02:00
parent 915eea8fef
commit 39677c1b0f

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;