Return in case of possible overflow

This commit is contained in:
Yamagi Burmeister 2012-06-02 13:18:33 +02:00
parent 41a704a13e
commit afd2f4538c

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';