From 0aac200258219fb2f0bef5cd01a6b5ce2b193205 Mon Sep 17 00:00:00 2001 From: MysterD Date: Sun, 7 May 2023 15:56:56 -0700 Subject: [PATCH] Fixed crash in packet_ordered_check_for_processing --- src/pc/network/packets/packet_ordered.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pc/network/packets/packet_ordered.c b/src/pc/network/packets/packet_ordered.c index 13f75a02..d5f61d56 100644 --- a/src/pc/network/packets/packet_ordered.c +++ b/src/pc/network/packets/packet_ordered.c @@ -24,8 +24,7 @@ static struct OrderedPacketTable* orderedPacketTable[MAX_PLAYERS] = { 0 }; u8 gAllowOrderedPacketClear = 1; static void packet_ordered_check_for_processing(struct OrderedPacketTable* opt) { - // sanity check - SOFT_ASSERT(opt != NULL); + if (!opt) { return; } struct OrderedPacketList* opl = opt->packets; struct OrderedPacketList* oplLast = opl; @@ -52,7 +51,7 @@ static void packet_ordered_check_for_processing(struct OrderedPacketTable* opt) if (oplLast == opl) { // we processed the head of the list opt->packets = opl->next; - } else { + } else if (oplLast) { // we processed from after the head oplLast->next = opl->next; }