From 17026abe3670f6e3a0b3d0f94e53b3308e8470a7 Mon Sep 17 00:00:00 2001 From: black Date: Mon, 23 May 2005 22:11:43 +0000 Subject: [PATCH] -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 --- netconn.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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)) { -- 2.39.2