Fixed possible crash when reloading a plugin with an invalid binary (bug 5288, r=psychonic).
This commit is contained in:
parent
c15a91dbcc
commit
6121c098c8
@ -1004,12 +1004,15 @@ LoadRes CPluginManager::_LoadPlugin(CPlugin **_plugin, const char *path, bool de
|
||||
|
||||
pPlugin->m_pRuntime = g_pSourcePawn2->LoadPlugin(co, fullpath, &err);
|
||||
if (pPlugin->m_pRuntime == NULL)
|
||||
{
|
||||
if (error)
|
||||
{
|
||||
UTIL_Format(error,
|
||||
maxlength,
|
||||
"Unable to load plugin (error %d: %s)",
|
||||
err,
|
||||
g_pSourcePawn2->GetErrorString(err));
|
||||
}
|
||||
pPlugin->m_status = Plugin_BadLoad;
|
||||
}
|
||||
else
|
||||
@ -1019,11 +1022,14 @@ LoadRes CPluginManager::_LoadPlugin(CPlugin **_plugin, const char *path, bool de
|
||||
pPlugin->m_status = Plugin_Created;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (error)
|
||||
{
|
||||
UTIL_Format(error, maxlength, "%s", pPlugin->m_errormsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LoadRes loadFailure = LoadRes_Failure;
|
||||
/* Get the status */
|
||||
|
Loading…
Reference in New Issue
Block a user