Return in case of possible overflow

This commit is contained in:
Yamagi Burmeister 2012-06-02 13:18:33 +02:00
parent ef3c9bf620
commit bf02575b1e

View file

@ -1110,7 +1110,9 @@ Com_sprintf(char *dest, int size, char *fmt, ...)
if ((len >= size) || (len == size))
{
Com_Printf("Com_sprintf: overflow\n");
len = size - 1;
dest = NULL;
return;
}
bigbuffer[size - 1] = '\0';