]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
-Fix checking the length before knowing its actual value(??)
authorblack <black@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 23 May 2005 22:11:43 +0000 (22:11 +0000)
committerblack <black@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 23 May 2005 22:11:43 +0000 (22:11 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5323 d7cf8633-e32d-0410-b094-e92efae38249

netconn.c

index 713b46780be9409afb4285ee19f67edfbca3528b..6f96f28ba0e1d0b9473dee7d4f436287eebef544 100755 (executable)
--- 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))
                {