fix: security vulnerabilities

Tested that all functions related to the touched files work

will test sqlite on a CI build
This commit is contained in:
David Markowitz
2026-06-06 23:13:09 -07:00
parent 8e09ffd6e8
commit fb166bd24d
107 changed files with 786 additions and 512 deletions

View File

@@ -13,7 +13,10 @@ void CavePrisonCage::OnStartup(Entity* self) {
return;
}
auto* spawner = Game::zoneManager->GetSpawnersByName("PrisonCounterweight_0" + GeneralUtils::UTF16ToWTF8(myNum))[0];
const auto spawners = Game::zoneManager->GetSpawnersByName("PrisonCounterweight_0" + GeneralUtils::UTF16ToWTF8(myNum));
if (spawners.empty()) return;
auto* spawner = spawners[0];
self->SetVar<Spawner*>(u"CWSpawner", spawner);
@@ -21,6 +24,7 @@ void CavePrisonCage::OnStartup(Entity* self) {
}
void CavePrisonCage::Setup(Entity* self, Spawner* spawner) {
if (!spawner) return;
SpawnCounterweight(self, spawner);
NiPoint3 mypos = self->GetPosition();
@@ -62,6 +66,8 @@ void CavePrisonCage::OnQuickBuildNotifyState(Entity* self, eQuickBuildState stat
}
void CavePrisonCage::SpawnCounterweight(Entity* self, Spawner* spawner) {
if (!spawner) return;
spawner->Reset();
auto* counterweight = spawner->Spawn();
@@ -164,7 +170,8 @@ void CavePrisonCage::OnTimerDone(Entity* self, std::string timerName) {
const auto flagNum = 2020 + self->GetVarAs<int32_t>(u"myNumber");
// Set the flag on the builder character
builder->GetCharacter()->SetPlayerFlag(flagNum, true);
auto* const character = builder->GetCharacter();
if (character) character->SetPlayerFlag(flagNum, true);
// Setup a timer named 'VillagerEscape' to be triggered in 5 seconds
self->AddTimer("VillagerEscape", 5.0f);

View File

@@ -408,7 +408,7 @@ void NjMonastryBossInstance::SummonWave(Entity* self, Entity* frakjaw) {
// Stop the music for the first, fourth and fifth wave
const auto wave = self->GetVar<uint32_t>(WaveNumberVariable);
if (wave >= 1 || wave < (m_Waves.size() - 1)) {
if (wave >= 1 && wave < (m_Waves.size() - 1)) {
GameMessages::SendNotifyClientObject(self->GetObjectID(), StopMusicNotification, 0, 0,
LWOOBJID_EMPTY, AudioWaveAudio + std::to_string(wave - 1),
UNASSIGNED_SYSTEM_ADDRESS);