summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZachary Slater <zachary@ioquake.org>2011-12-25 09:07:36 +0000
committerTim Angus <tim@ngus.net>2013-01-12 20:17:23 +0000
commitf81633eb01f8abd98aec47e8aa07e89f44c5e99a (patch)
treeed6210b5c7011fc7e53ef05babb9a75495884218
parent062dc39522c4e82f67dd5893b177545ce3cdf1b2 (diff)
bugzilla bug #5273 exploit resolved, we're now disallowing forwardmove of -128 and vice versa
Thanks, devhc!
-rw-r--r--src/qcommon/msg.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/qcommon/msg.c b/src/qcommon/msg.c
index f8aa39ee..a0c17d73 100644
--- a/src/qcommon/msg.c
+++ b/src/qcommon/msg.c
@@ -704,8 +704,14 @@ void MSG_ReadDeltaUsercmd( msg_t *msg, usercmd_t *from, usercmd_t *to ) {
to->angles[1] = MSG_ReadDelta( msg, from->angles[1], 16);
to->angles[2] = MSG_ReadDelta( msg, from->angles[2], 16);
to->forwardmove = MSG_ReadDelta( msg, from->forwardmove, 8);
+ if( to->forwardmove == -128 )
+ to->forwardmove = -127;
to->rightmove = MSG_ReadDelta( msg, from->rightmove, 8);
+ if( to->rightmove == -128 )
+ to->rightmove = -127;
to->upmove = MSG_ReadDelta( msg, from->upmove, 8);
+ if( to->upmove == -128 )
+ to->upmove = -127;
to->buttons = MSG_ReadDelta( msg, from->buttons, 16);
to->weapon = MSG_ReadDelta( msg, from->weapon, 8);
}
@@ -765,8 +771,14 @@ void MSG_ReadDeltaUsercmdKey( msg_t *msg, int key, usercmd_t *from, usercmd_t *t
to->angles[1] = MSG_ReadDeltaKey( msg, key, from->angles[1], 16);
to->angles[2] = MSG_ReadDeltaKey( msg, key, from->angles[2], 16);
to->forwardmove = MSG_ReadDeltaKey( msg, key, from->forwardmove, 8);
+ if( to->forwardmove == -128 )
+ to->forwardmove = -127;
to->rightmove = MSG_ReadDeltaKey( msg, key, from->rightmove, 8);
+ if( to->rightmove == -128 )
+ to->rightmove = -127;
to->upmove = MSG_ReadDeltaKey( msg, key, from->upmove, 8);
+ if( to->upmove == -128 )
+ to->upmove = -127;
to->buttons = MSG_ReadDeltaKey( msg, key, from->buttons, 16);
to->weapon = MSG_ReadDeltaKey( msg, key, from->weapon, 8);
} else {