Permalink
Browse files

Fix assertions for payload bytes

A couple of instances of payload bytes were being compared against MAX_PACKET_BYTES instead of MAX_PAYLOAD_BYTES.
  • Loading branch information...
stellarLuminant committed Feb 8, 2019
1 parent 2815649 commit b96c6bb65f11c83c89823af897e7bb3b10741f5c
Showing with 2 additions and 2 deletions.
  1. +2 −2 netcode.c
@@ -3357,7 +3357,7 @@ uint8_t * netcode_client_receive_packet( struct netcode_client_t * client, int *
netcode_assert( packet->packet_type == NETCODE_CONNECTION_PAYLOAD_PACKET );
*packet_bytes = packet->payload_bytes;
netcode_assert( *packet_bytes >= 0 );
netcode_assert( *packet_bytes <= NETCODE_MAX_PACKET_BYTES );
netcode_assert( *packet_bytes <= NETCODE_MAX_PAYLOAD_BYTES );
return (uint8_t*) &packet->payload_data;
}
else
@@ -4856,7 +4856,7 @@ uint8_t * netcode_server_receive_packet( struct netcode_server_t * server, int c
netcode_assert( packet->packet_type == NETCODE_CONNECTION_PAYLOAD_PACKET );
*packet_bytes = packet->payload_bytes;
netcode_assert( *packet_bytes >= 0 );
netcode_assert( *packet_bytes <= NETCODE_MAX_PACKET_BYTES );
netcode_assert( *packet_bytes <= NETCODE_MAX_PAYLOAD_BYTES );
return (uint8_t*) &packet->payload_data;
}
else

0 comments on commit b96c6bb

Please sign in to comment.