mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-03-30 14:29:04 +03:00
Prevent signed overflow (UB) in SquirrelVM::GenerateUniqueKey()
This commit is contained in:
parent
359fcb7196
commit
696036219e
@ -2776,7 +2776,7 @@ void* SquirrelVM::GetInstanceValue(HSCRIPT hInstance, ScriptClassDesc_t* pExpect
|
|||||||
|
|
||||||
bool SquirrelVM::GenerateUniqueKey(const char* pszRoot, char* pBuf, int nBufSize)
|
bool SquirrelVM::GenerateUniqueKey(const char* pszRoot, char* pBuf, int nBufSize)
|
||||||
{
|
{
|
||||||
static int keyIdx = 0;
|
static unsigned keyIdx = 0;
|
||||||
// This gets used for script scope, still confused why it needs to be inside IScriptVM
|
// This gets used for script scope, still confused why it needs to be inside IScriptVM
|
||||||
// is it just to be a compatible name for CreateScope?
|
// is it just to be a compatible name for CreateScope?
|
||||||
V_snprintf(pBuf, nBufSize, "%08X_%s", ++keyIdx, pszRoot);
|
V_snprintf(pBuf, nBufSize, "%08X_%s", ++keyIdx, pszRoot);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user