From fb3b786df5159b7a2a67dda8c51cd48a78801d50 Mon Sep 17 00:00:00 2001 From: Jeff Kent Date: Fri, 20 Mar 2015 19:24:07 -0500 Subject: fix buffer overflow in CL_CheckForResend --- src/client/cl_main.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/client/cl_main.c b/src/client/cl_main.c index 5b3f6028..77df2e01 100644 --- a/src/client/cl_main.c +++ b/src/client/cl_main.c @@ -2356,9 +2356,9 @@ Resend a connect message if the last one has timed out ================= */ void CL_CheckForResend( void ) { - int port, i; + int port; char info[MAX_INFO_STRING]; - char data[MAX_INFO_STRING]; + char data[MAX_INFO_STRING + 10]; // don't send anything if playing back a demo if ( clc.demoplaying ) { @@ -2399,19 +2399,8 @@ void CL_CheckForResend( void ) { Info_SetValueForKey( info, "qport", va("%i", port ) ); Info_SetValueForKey( info, "challenge", va("%i", clc.challenge ) ); - strcpy(data, "connect "); - // TTimo adding " " around the userinfo string to avoid truncated userinfo on the server - // (Com_TokenizeString tokenizes around spaces) - data[8] = '"'; - - for(i=0;i