1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2024-12-23 01:59:43 +08:00

Correct CSplitString constructors (#272)

Fixes potential crashes and invalid member access
This commit is contained in:
Poggu 2024-10-04 15:18:59 +02:00 committed by GitHub
parent 9f1d960f6a
commit 05e47e5611
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1194,14 +1194,14 @@ public:
class CSplitString: public CUtlVector<char*, CUtlMemory<char*, int> >
{
public:
CSplitString(const char *pString, const char *pSeparator, bool bIncludeSeparators = false)
CSplitString(const char *pString, const char *pSeparator, bool bIncludeSeparators = false) : m_szBuffer(nullptr)
{
Split( pString, 0, &pSeparator, 1, bIncludeSeparators);
Split( pString, -1, &pSeparator, 1, bIncludeSeparators);
}
CSplitString(const char *pString, const char **pSeparators, int nSeparators, bool bIncludeSeparators = false)
CSplitString(const char *pString, const char **pSeparators, int nSeparators, bool bIncludeSeparators = false) : m_szBuffer(nullptr)
{
Split(pString, 0, pSeparators, nSeparators, bIncludeSeparators);
Split(pString, -1, pSeparators, nSeparators, bIncludeSeparators);
}
~CSplitString()