DarkflameServer/dScripts
David Markowitz 23d71340c9
Scripts: Fix possible nullptr access (#1232)
unsure how to reproduce the actual bug, however we can see that with the following crash dump
```
Entity::GetComponent(eReplicaComponentType) const(+0x4) [0x56095665e634]
BossSpiderQueenEnemyServer::OnDie(Entity*, Entity*)(+0x28d) [0x560956795d0d]
Entity::Kill(Entity*)(+0xf8) [0x5609566637a8]
ZoneAgProperty::BaseTimerDone(Entity*, std::string const&)(+0x89b) [0x56095683736b]
Entity::Update(float)(+0x2b6) [0x560956662676]
EntityManager::UpdateEntities(float)(+0x2e) [0x56095667305e]
```
that the actual crash issue starts at
```
Entity::Kill(Entity*)(+0xf8) [0x5609566637a8]
ZoneAgProperty::BaseTimerDone(Entity*, std::string const&)
```
BaseTimerDone calls Kill, and there is only 1 call to Kill in the function which calls Kill no arguments, meaning the killer is a nullptr.  This propogates its way to the BossSpiderQueenEnemyServer::OnDie wherein we blindly check the killer pointer without verifying that the pointer is actually valid.

This patch simply checks that killer is valid before access to address the hole.
2023-10-22 14:53:54 -07:00
..
02_server Scripts: Fix possible nullptr access (#1232) 2023-10-22 14:53:54 -07:00
ai feat: Abstract Logger and simplify code (#1207) 2023-10-21 16:31:55 -07:00
client Breakout rest of the enums from dCommonVars and clean it up (#1061) 2023-05-02 17:39:21 -05:00
EquipmentScripts Move EntityManager to Game namespace (#1140) 2023-07-15 13:56:33 -07:00
EquipmentTriggers Make wrapper for casting skills (#987) 2023-02-10 02:30:17 -06:00
zone Fix typing of some player flag variables (#1067) 2023-05-06 13:32:26 -05:00
ActivityManager.cpp feat: Abstract Logger and simplify code (#1207) 2023-10-21 16:31:55 -07:00
ActivityManager.h Scripts: Fix ambiguous base class (#1216) 2023-10-09 15:31:25 -05:00
BaseConsoleTeleportServer.cpp Move EntityManager to Game namespace (#1140) 2023-07-15 13:56:33 -07:00
BaseConsoleTeleportServer.h format codebase 2022-07-28 08:39:57 -05:00
BasePropertyServer.cpp Move dZoneManager to game namespace (#1143) 2023-07-17 17:55:33 -05:00
BasePropertyServer.h Scripts: Fix ambiguous base class (#1216) 2023-10-09 15:31:25 -05:00
BaseRandomServer.cpp feat: Abstract Logger and simplify code (#1207) 2023-10-21 16:31:55 -07:00
BaseRandomServer.h format codebase 2022-07-28 08:39:57 -05:00
BaseSurvivalServer.cpp fix: Remove usage of rand() and seed randomness for chatserver (#1152) 2023-08-03 21:38:19 -05:00
BaseSurvivalServer.h format codebase 2022-07-28 08:39:57 -05:00
BaseWavesGenericEnemy.cpp Move dZoneManager to game namespace (#1143) 2023-07-17 17:55:33 -05:00
BaseWavesGenericEnemy.h Scripts: Fix ambiguous base class (#1216) 2023-10-09 15:31:25 -05:00
BaseWavesServer.cpp Merge branch 'main' into pr/1107 2023-07-21 19:40:30 -07:00
BaseWavesServer.h format codebase 2022-07-28 08:39:57 -05:00
ChooseYourDestinationNsToNt.cpp Breakout rest of the enums from dCommonVars and clean it up (#1061) 2023-05-02 17:39:21 -05:00
ChooseYourDestinationNsToNt.h format codebase 2022-07-28 08:39:57 -05:00
CMakeLists.txt Implement the Imaginite Backpack and Shard armor scripts (#886) 2022-12-21 14:33:41 -08:00
CppScripts.cpp feat: Abstract Logger and simplify code (#1207) 2023-10-21 16:31:55 -07:00
CppScripts.h Scripts: Fix ambiguous base class (#1216) 2023-10-09 15:31:25 -05:00
Darkitect.cpp Move EntityManager to Game namespace (#1140) 2023-07-15 13:56:33 -07:00
Darkitect.h Optimize scripts for faster compilation (#597) 2022-07-04 23:00:10 -07:00
NPCAddRemoveItem.cpp Breakout rest of the enums from dCommonVars and clean it up (#1061) 2023-05-02 17:39:21 -05:00
NPCAddRemoveItem.h Scripts: Fix ambiguous base class (#1216) 2023-10-09 15:31:25 -05:00
NtFactionSpyServer.cpp Breakout rest of the enums from dCommonVars and clean it up (#1061) 2023-05-02 17:39:21 -05:00
NtFactionSpyServer.h Breakout rest of the enums from dCommonVars and clean it up (#1061) 2023-05-02 17:39:21 -05:00
ScriptComponent.cpp chore: Make serialize actually virtual (#1156) 2023-08-10 14:33:15 -07:00
ScriptComponent.h chore: Make serialize actually virtual (#1156) 2023-08-10 14:33:15 -07:00
ScriptedPowerupSpawner.cpp perf: Loot memory savings (#1165) 2023-10-09 15:33:22 -05:00
ScriptedPowerupSpawner.h format codebase 2022-07-28 08:39:57 -05:00
SpawnPetBaseServer.cpp Move EntityManager to Game namespace (#1140) 2023-07-15 13:56:33 -07:00
SpawnPetBaseServer.h format codebase 2022-07-28 08:39:57 -05:00