Skip to content

Commit a1a1480

Browse files
committedDec 20, 2024·
Fix reading null bytes in UpdatePingStatus
Addendum for 52d4f0c
1 parent 6768df5 commit a1a1480

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed
 

‎Client/core/CQueryReceiver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ SQueryInfo CQueryReceiver::GetServerResponse()
183183

184184
// Recover server ping status if present
185185
const SString strPingStatus = strBuildNumber.Right(strBuildNumber.length() - strlen(strBuildNumber) - 1);
186-
CCore::GetSingleton().GetNetwork()->UpdatePingStatus(*strPingStatus, info.players, info.isStatusVerified);
186+
CCore::GetSingleton().GetNetwork()->UpdatePingStatus(strPingStatus.c_str(), strPingStatus.length(), info.players, info.isStatusVerified);
187187

188188
// Recover server http port if present
189189
const SString strNetRoute = strPingStatus.Right(strPingStatus.length() - strlen(strPingStatus) - 1);

‎Client/sdk/net/CNet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class CNet
115115

116116
virtual const char* GetNextBuffer() = 0;
117117
virtual const char* GetDiagnosticStatus() = 0;
118-
virtual void UpdatePingStatus(const char* szStatus, ushort& usDataRef, bool& isVerified) = 0;
118+
virtual void UpdatePingStatus(const char* status, size_t statusLength, ushort& usDataRef, bool& isVerified) = 0;
119119

120120
virtual bool VerifySignature(const char* pData, unsigned long ulSize) = 0;
121121

‎Shared/sdk/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108

109109
#define _ASE_VERSION QUOTE_DEFINE(MTASA_VERSION_MAJOR) "." QUOTE_DEFINE(MTASA_VERSION_MINOR)
110110
#define _NETCODE_VERSION_BRANCH_ID 0x4 // Use 0x1 - 0xF to indicate an incompatible branch is being used (0x0 is reserved, 0x4 is trunk)
111-
#define _CLIENT_NET_MODULE_VERSION 0x0AF // (0x000 - 0xfff) Lvl9 wizards only
111+
#define _CLIENT_NET_MODULE_VERSION 0x0B0 // (0x000 - 0xfff) Lvl9 wizards only
112112
#define _SERVER_NET_MODULE_VERSION 0x0AB // (0x000 - 0xfff) Lvl9 wizards only
113113
#define _NETCODE_VERSION 0x1DA // (0x000 - 0xfff) Increment when net messages change (pre-release)
114114

0 commit comments

Comments
 (0)
Please sign in to comment.