Pylon: fix use after free

The member must contain a copy of the string, pointing it to the buffer used by the language cvar results in undefined behavior. Several cases were the string pointed to random data were reported.
This commit is contained in:
Kawe Mazidjatari 2023-10-08 16:37:10 +02:00
parent 723052eb6f
commit b3e768190c
2 changed files with 2 additions and 3 deletions

View File

@ -390,8 +390,7 @@ bool CPylon::QueryServer(const char* endpoint, const char* request,
string finalUrl;
CURLFormatUrl(finalUrl, hostName, endpoint);
finalUrl += Format("?language=%s", this->m_Language);
finalUrl += Format("?language=%s", this->m_Language.c_str());
CURLParams params;

View File

@ -34,6 +34,6 @@ public:
private:
string m_Token;
string m_ErrorMsg;
const char* m_Language;
string m_Language;
};
extern CPylon* g_pMasterServer;