Steam_Apps::GetCurrentBetaName() make sure the out buffer is null terminated

This commit is contained in:
otavepto 2024-03-17 01:58:57 +02:00
parent f00fdac3ac
commit 5417e0e4c2
2 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,8 @@
* **[bitsynth]** Fix Age of Empires 2: Definitive Edition, the game expects the app itself to be an owned DLC
otherwise most options will be disabled
* `Steam_Apps::GetCurrentBetaName()` make sure the out buffer is null terminated
---
# 2024/3/16

View File

@ -232,9 +232,10 @@ void Steam_Apps::RequestAppProofOfPurchaseKey( AppId_t nAppID )
// https://partner.steamgames.com/doc/api/ISteamApps
bool Steam_Apps::GetCurrentBetaName( char *pchName, int cchNameBufferSize )
{
PRINT_DEBUG("Steam_Apps::GetCurrentBetaName %i\n", cchNameBufferSize);
PRINT_DEBUG("Steam_Apps::GetCurrentBetaName %p [%i]\n", pchName, cchNameBufferSize);
std::lock_guard<std::recursive_mutex> lock(global_mutex);
if (pchName && cchNameBufferSize > settings->current_branch_name.size()) {
memset(pchName, 0, cchNameBufferSize);
memcpy(pchName, settings->current_branch_name.c_str(), settings->current_branch_name.size());
}