(svn r2899) -Fix: Several format string vulnerabilities and buffer overflows in the network code

This commit is contained in:
tron
2005-08-28 12:24:57 +00:00
parent 70c07d13be
commit d975abc96c
5 changed files with 13 additions and 13 deletions

View File

@@ -100,7 +100,7 @@ void CDECL NetworkTextMessage(NetworkAction action, uint16 color, bool self_send
char temp[1024];
va_start(va, str);
vsprintf(buf, str, va);
vsnprintf(buf, lengthof(buf), str, va);
va_end(va);
switch (action) {
@@ -499,7 +499,7 @@ void NetworkCloseClient(NetworkClientState *cs)
GetString(str, STR_NETWORK_ERR_CLIENT_GENERAL + errorno);
NetworkTextMessage(NETWORK_ACTION_LEAVE, 1, false, client_name, str);
NetworkTextMessage(NETWORK_ACTION_LEAVE, 1, false, client_name, "%s", str);
// Inform other clients of this... strange leaving ;)
FOR_ALL_CLIENTS(new_cs) {