From b4b66172244f94a81f8476b3050cc7ad35281cc1 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 20 May 2024 14:23:35 -0600 Subject: [PATCH] lsteamclient: Zero unused output message pointers in networking_message_pool_receive(). CW-Bug-Id: #23829 --- lsteamclient/steam_networking_manual.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/lsteamclient/steam_networking_manual.c b/lsteamclient/steam_networking_manual.c index e2f95978..83ada555 100644 --- a/lsteamclient/steam_networking_manual.c +++ b/lsteamclient/steam_networking_manual.c @@ -88,7 +88,11 @@ static BOOL networking_message_pool_receive_144( int32_t capacity, int32_t count struct networking_message_pool *pool = CONTAINING_RECORD( messages[0], struct networking_message, w_msg_144 )->pool; int32_t i; - for (i = count; i < capacity; i++) messages[i]->m_pfnRelease( messages[i] ); + for (i = count; i < capacity; i++) + { + messages[i]->m_pfnRelease( messages[i] ); + messages[i] = NULL; + } if (count > 0) { @@ -156,7 +160,11 @@ static BOOL networking_message_pool_receive_147( uint32_t capacity, uint32_t cou struct networking_message_pool *pool = CONTAINING_RECORD( messages[0], struct networking_message, w_msg_147 )->pool; uint32_t i; - for (i = count; i < capacity; i++) messages[i]->m_pfnRelease( messages[i] ); + for (i = count; i < capacity; i++) + { + messages[i]->m_pfnRelease( messages[i] ); + messages[i] = NULL; + } if (count) { @@ -224,7 +232,11 @@ static BOOL networking_message_pool_receive_153a( uint32_t capacity, uint32_t co struct networking_message_pool *pool = CONTAINING_RECORD( messages[0], struct networking_message, w_msg_153a )->pool; uint32_t i; - for (i = count; i < capacity; i++) messages[i]->m_pfnRelease( messages[i] ); + for (i = count; i < capacity; i++) + { + messages[i]->m_pfnRelease( messages[i] ); + messages[i] = NULL; + } if (count) {