Skip to content

Commit

Permalink
Fix reading null bytes in UpdatePingStatus
Browse files Browse the repository at this point in the history
Addendum for 52d4f0c
  • Loading branch information
botder committed Dec 20, 2024
1 parent 6768df5 commit a1a1480
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Client/core/CQueryReceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ SQueryInfo CQueryReceiver::GetServerResponse()

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

// Recover server http port if present
const SString strNetRoute = strPingStatus.Right(strPingStatus.length() - strlen(strPingStatus) - 1);
Expand Down
2 changes: 1 addition & 1 deletion Client/sdk/net/CNet.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class CNet

virtual const char* GetNextBuffer() = 0;
virtual const char* GetDiagnosticStatus() = 0;
virtual void UpdatePingStatus(const char* szStatus, ushort& usDataRef, bool& isVerified) = 0;
virtual void UpdatePingStatus(const char* status, size_t statusLength, ushort& usDataRef, bool& isVerified) = 0;

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

Expand Down
2 changes: 1 addition & 1 deletion Shared/sdk/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@

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

Expand Down

0 comments on commit a1a1480

Please sign in to comment.