summaryrefslogtreecommitdiff
path: root/src/qcommon/q_shared.c
diff options
context:
space:
mode:
authorThilo Schulz <arny@ats.s.bawue.de>2011-04-27 16:03:35 +0000
committerTim Angus <tim@ngus.net>2013-01-09 17:07:53 +0000
commit0d5fef7f5c33fd4176b27c79d9cef7512801f471 (patch)
tree235166fccae70dcc97fca64b64a676a8e847a96e /src/qcommon/q_shared.c
parentc4186224a16b1dc238775bbe9ff3af4362c7d5eb (diff)
- Harden the client and server protocol against UDP spoofing attacks. This will defend ioquake3 against http://aluigi.altervista.org/papers/q3noclient.txt (#3041) - Retains full compatibility to the old but unsecure protocol between clients and servers - Harden the connection process against DoS attacks, possibly connected to UDP spoofing
Diffstat (limited to 'src/qcommon/q_shared.c')
-rw-r--r--src/qcommon/q_shared.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qcommon/q_shared.c b/src/qcommon/q_shared.c
index b4846799..9f7600b6 100644
--- a/src/qcommon/q_shared.c
+++ b/src/qcommon/q_shared.c
@@ -981,7 +981,7 @@ void Q_ParseNewlines( char *dest, const char *src, int destsize )
*dest++ = '\0';
}
-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;
@@ -992,6 +992,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);
+
+ return len;
}
/*