Squashed 'external/toxcore/c-toxcore/' changes from 75f3c33943..d4b06edc2a

d4b06edc2a feat: add ngc events
cd34b60f0f feat: allow for larger incoming NGC packets
94cf9d1f36 fix: Fix memory leak in the error path of loading savedata.
fc623a5281 tox_new() should return null when savedata loading fails
06d949a701 fix: always respond to version packets with toxcore version
REVERT: 75f3c33943 adopt to #2415 changes
REVERT: 38e4c82fe0 feat: add ngc events

git-subtree-dir: external/toxcore/c-toxcore
git-subtree-split: d4b06edc2a35bad51b0f0950d74f61c8c70630ab
This commit is contained in:
2023-11-17 16:01:52 +01:00
parent cdc4284cb5
commit 4f02c2b55b
8 changed files with 55 additions and 21 deletions

View File

@ -366,7 +366,7 @@ static uint16_t reassemble_packet(const Logger *log, GC_Connection *gconn, uint8
// search backwards in recv array until we find an empty slot or a non-fragment packet type
while (!array_entry_is_empty(entry) && entry->packet_type == GP_FRAGMENT) {
assert(entry->data != nullptr);
assert(entry->data_length <= MAX_GC_PACKET_CHUNK_SIZE);
assert(entry->data_length <= MAX_GC_PACKET_INCOMING_CHUNK_SIZE);
const uint16_t diff = packet_length + entry->data_length;