Skip to content

Commit

Permalink
fix: fixes requested in review
Browse files Browse the repository at this point in the history
  • Loading branch information
zoff99 committed Jan 15, 2024
1 parent 772a102 commit d8ac8e0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion other/bootstrap_daemon/docker/tox-bootstrapd.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7e86d4f1c4aadce01a03153f2101ac1486f6de65f824b7b0cccbbfbf832c180a /usr/local/bin/tox-bootstrapd
cf5ba4e6cce9f012b11b62aa1c5517c0c51e1f9154d8e7b6ff468c466eac7e1b /usr/local/bin/tox-bootstrapd
12 changes: 1 addition & 11 deletions toxcore/group_chats.c
Original file line number Diff line number Diff line change
Expand Up @@ -4997,17 +4997,7 @@ static bool custom_gc_packet_length_is_valid(uint16_t length, bool lossless)
/** @brief Returns false if a custom incoming (non private) packet is too large. */
static bool custom_gc_incoming_non_private_packet_length_is_valid(uint16_t length, bool lossless)
{
if (lossless) {
if (length > MAX_GC_CUSTOM_LOSSLESS_INCOMING_ASSEMBLED_PACKET_SIZE) {
return false;
}
} else {
if (length > MAX_GC_CUSTOM_LOSSY_PACKET_SIZE) {
return false;
}
}

return true;
return length <= (lossless ? MAX_GC_CUSTOM_LOSSLESS_INCOMING_ASSEMBLED_PACKET_SIZE : MAX_GC_CUSTOM_LOSSY_PACKET_SIZE);
}

int gc_send_custom_private_packet(const GC_Chat *chat, bool lossless, uint32_t peer_id, const uint8_t *message,
Expand Down
6 changes: 3 additions & 3 deletions toxcore/group_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
/* Max size of a complete encrypted packet including headers. */
#define MAX_GC_PACKET_SIZE (MAX_GC_PACKET_CHUNK_SIZE * 100)

/* allow incoming NGC custom packets that are non private to be up to the total max size of MAX_GC_PACKET_SIZE
* which is 50000 bytes. the data itself can only be less than that because of NGC header overhead
/* Allow incoming NGC custom packets that are non private to be up to the total max size of MAX_GC_PACKET_SIZE.
* The data itself can only be less than that because of NGC header overhead
*/
#define MAX_GC_CUSTOM_LOSSLESS_INCOMING_ASSEMBLED_PACKET_SIZE MAX_GC_PACKET_SIZE
#define MAX_GC_CUSTOM_LOSSLESS_INCOMING_ASSEMBLED_PACKET_SIZE MAX_GC_PACKET_SIZE


/* Max number of messages to store in the send/recv arrays */
Expand Down

0 comments on commit d8ac8e0

Please sign in to comment.