mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-03-27 12:59:05 +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)
|
||||
{
|
||||
static int keyIdx = 0;
|
||||
static unsigned keyIdx = 0;
|
||||
// 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?
|
||||
V_snprintf(pBuf, nBufSize, "%08X_%s", ++keyIdx, pszRoot);
|
||||
|
Loading…
x
Reference in New Issue
Block a user