- Add better protection against DoSing connecting users from connecting
- Have Com_sprintf return string length - add STR_LEN macro for static strings
This commit is contained in:
parent
53d89b6c10
commit
74e538ffcf
4 changed files with 37 additions and 18 deletions
|
@ -919,7 +919,7 @@ int Q_CountChar(const char *string, char tocount)
|
|||
return count;
|
||||
}
|
||||
|
||||
void QDECL Com_sprintf(char *dest, int size, const char *fmt, ...)
|
||||
int QDECL Com_sprintf(char *dest, int size, const char *fmt, ...)
|
||||
{
|
||||
int len;
|
||||
va_list argptr;
|
||||
|
@ -930,6 +930,8 @@ void QDECL Com_sprintf(char *dest, int size, const char *fmt, ...)
|
|||
|
||||
if(len >= size)
|
||||
Com_Printf("Com_sprintf: Output length %d too short, require %d bytes.\n", size, len + 1);
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue