Skip to content

Commit

Permalink
Fix assertions for payload bytes
Browse files Browse the repository at this point in the history
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 b96c6bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions netcode.c
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b96c6bb

Please sign in to comment.