Skip to content

Commit d8ac8e0

Browse files
committed
fix: fixes requested in review
1 parent 772a102 commit d8ac8e0

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7e86d4f1c4aadce01a03153f2101ac1486f6de65f824b7b0cccbbfbf832c180a /usr/local/bin/tox-bootstrapd
1+
cf5ba4e6cce9f012b11b62aa1c5517c0c51e1f9154d8e7b6ff468c466eac7e1b /usr/local/bin/tox-bootstrapd

toxcore/group_chats.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4997,17 +4997,7 @@ static bool custom_gc_packet_length_is_valid(uint16_t length, bool lossless)
49974997
/** @brief Returns false if a custom incoming (non private) packet is too large. */
49984998
static bool custom_gc_incoming_non_private_packet_length_is_valid(uint16_t length, bool lossless)
49994999
{
5000-
if (lossless) {
5001-
if (length > MAX_GC_CUSTOM_LOSSLESS_INCOMING_ASSEMBLED_PACKET_SIZE) {
5002-
return false;
5003-
}
5004-
} else {
5005-
if (length > MAX_GC_CUSTOM_LOSSY_PACKET_SIZE) {
5006-
return false;
5007-
}
5008-
}
5009-
5010-
return true;
5000+
return length <= (lossless ? MAX_GC_CUSTOM_LOSSLESS_INCOMING_ASSEMBLED_PACKET_SIZE : MAX_GC_CUSTOM_LOSSY_PACKET_SIZE);
50115001
}
50125002

50135003
int gc_send_custom_private_packet(const GC_Chat *chat, bool lossless, uint32_t peer_id, const uint8_t *message,

toxcore/group_common.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@
4545
/* Max size of a complete encrypted packet including headers. */
4646
#define MAX_GC_PACKET_SIZE (MAX_GC_PACKET_CHUNK_SIZE * 100)
4747

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

5353

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

0 commit comments

Comments
 (0)