From 0d5fef7f5c33fd4176b27c79d9cef7512801f471 Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Wed, 27 Apr 2011 16:03:35 +0000 Subject: - 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 --- src/qcommon/q_shared.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/qcommon/q_shared.c') 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; } /* -- cgit