From: havoc Date: Tue, 22 Jul 2003 16:31:39 +0000 (+0000) Subject: use proper string for conn->address when accepting a new client (otherwise it could... X-Git-Tag: xonotic-v0.1.0preview~6505 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e76f5bbe8ce08bc00fb4a4ad26a9418dac663639;p=xonotic%2Fdarkplaces.git use proper string for conn->address when accepting a new client (otherwise it could easily be so bogus as to trash the netconn structure) thanks very much to Tomaz for tracking down this major bug git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3304 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/netconn.c b/netconn.c index ab269e98..363fbb9e 100755 --- a/netconn.c +++ b/netconn.c @@ -1012,9 +1012,9 @@ int NetConn_ServerParsePacket(lhnetsocket_t *mysocket, qbyte *data, int length, if ((conn = NetConn_Open(mysocket, peeraddress))) { // allocated connection - strcpy(conn->address, addressstring2); + LHNETADDRESS_ToString(peeraddress, conn->address, sizeof(conn->address), true); if (developer.integer) - Con_Printf("Datagram_ParseConnectionless: sending \"accept\" to %s.\n", addressstring2); + Con_Printf("Datagram_ParseConnectionless: sending \"accept\" to %s.\n", conn->address); NetConn_WriteString(mysocket, "\377\377\377\377accept", peeraddress); // now set up the client struct SV_ConnectClient(clientnum, conn);