fix pqrcon rcon_password bug introduced in r9420 (was not
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 9 Jun 2010 21:05:14 +0000 (21:05 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 9 Jun 2010 21:05:14 +0000 (21:05 +0000)
nul-terminating a string)

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10233 d7cf8633-e32d-0410-b094-e92efae38249

host_cmd.c

index 202e4d9..530cf4e 100644 (file)
@@ -2492,6 +2492,7 @@ void Host_PQRcon_f (void)
                MSG_WriteLong (&net_message, 0);
                MSG_WriteByte (&net_message, CCREQ_RCON);
                SZ_Write(&net_message, (void*)rcon_password.string, n);
                MSG_WriteLong (&net_message, 0);
                MSG_WriteByte (&net_message, CCREQ_RCON);
                SZ_Write(&net_message, (void*)rcon_password.string, n);
+               MSG_WriteByte (&net_message, 0); // terminate the (possibly partial) string
                MSG_WriteString (&net_message, Cmd_Args());
                StoreBigLong(net_message.data, NETFLAG_CTL | (net_message.cursize & NETFLAG_LENGTH_MASK));
                NetConn_Write(mysocket, net_message.data, net_message.cursize, &to);
                MSG_WriteString (&net_message, Cmd_Args());
                StoreBigLong(net_message.data, NETFLAG_CTL | (net_message.cursize & NETFLAG_LENGTH_MASK));
                NetConn_Write(mysocket, net_message.data, net_message.cursize, &to);