From: black Date: Mon, 23 May 2005 22:11:43 +0000 (+0000) Subject: -Fix checking the length before knowing its actual value(??) X-Git-Tag: xonotic-v0.1.0preview~4858 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=17026abe3670f6e3a0b3d0f94e53b3308e8470a7;p=xonotic%2Fdarkplaces.git -Fix checking the length before knowing its actual value(??) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5323 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/netconn.c b/netconn.c index 713b4678..6f96f28b 100755 --- a/netconn.c +++ b/netconn.c @@ -764,11 +764,11 @@ int NetConn_ReceivedMessage(netconn_t *conn, qbyte *data, int length) unsigned int flags; unsigned int sequence; - if (length >= 8) + length = BigLong(((int *)data)[0]); + flags = length & ~NETFLAG_LENGTH_MASK; + length &= NETFLAG_LENGTH_MASK; + if (length >= 8) { - length = BigLong(((int *)data)[0]); - flags = length & ~NETFLAG_LENGTH_MASK; - length &= NETFLAG_LENGTH_MASK; // control packets were already handled if (!(flags & NETFLAG_CTL)) {