mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-06-09 08:14:20 +00:00
fix: security vulnerabilities (#1980)
* fix: security vulnerabilities Tested that all functions related to the touched files work will test sqlite on a CI build * fix failing test * ai feedback * add buffer size checking * use c_str * dont log session key * Try this for a mac definition * be quiet apple
This commit is contained in:
@@ -53,7 +53,7 @@ Spawner::Spawner(const SpawnerInfo info) {
|
||||
}
|
||||
for (Spawner* ssSpawner : spawnSmashSpawnersN) {
|
||||
m_SpawnSmashFoundGroup = true;
|
||||
m_SpawnOnSmash = ssSpawner;
|
||||
m_SpawnOnSmashID = ssSpawner ? ssSpawner->m_Info.spawnerID : LWOOBJID_EMPTY;
|
||||
ssSpawner->AddSpawnedEntityDieCallback([=, this]() {
|
||||
Spawn();
|
||||
});
|
||||
@@ -185,12 +185,14 @@ void Spawner::Update(const float deltaTime) {
|
||||
}
|
||||
return;
|
||||
}
|
||||
for (size_t i = 0; i < m_WaitTimes.size(); ++i) {
|
||||
for (size_t i = 0; i < m_WaitTimes.size(); ) {
|
||||
m_WaitTimes[i] += deltaTime;
|
||||
if (m_WaitTimes[i] >= m_Info.respawnTime) {
|
||||
m_WaitTimes.erase(m_WaitTimes.begin() + i);
|
||||
|
||||
Spawn();
|
||||
} else {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -222,15 +224,18 @@ void Spawner::NotifyOfEntityDeath(const LWOOBJID& objectID) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < node->entities.size(); ++i) {
|
||||
for (size_t i = 0; i < node->entities.size();) {
|
||||
if (node->entities[i] && node->entities[i] == objectID)
|
||||
node->entities.erase(node->entities.begin() + i);
|
||||
else
|
||||
i++;
|
||||
}
|
||||
|
||||
m_Entities.erase(objectID);
|
||||
|
||||
if (m_SpawnOnSmash != nullptr) {
|
||||
m_SpawnOnSmash->Reset();
|
||||
auto* const spawnOnSmash = Game::zoneManager->GetSpawner(m_SpawnOnSmashID);
|
||||
if (spawnOnSmash) {
|
||||
spawnOnSmash->Reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user