DarkflameServer/dScripts/02_server
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
..
DLU Remove inlines 2023-03-26 02:59:46 -07:00
Enemy Scripts: Fix possible nullptr access (#1232) 2023-10-22 14:53:54 -07:00
Equipment perf: Loot memory savings (#1165) 2023-10-09 15:33:22 -05:00
Map feat: Abstract Logger and simplify code (#1207) 2023-10-21 16:31:55 -07:00
Minigame perf: Loot memory savings (#1165) 2023-10-09 15:33:22 -05:00
Objects Move EntityManager to Game namespace (#1140) 2023-07-15 13:56:33 -07:00
Pets Breakout rest of the enums from dCommonVars and clean it up (#1061) 2023-05-02 17:39:21 -05:00
CMakeLists.txt Organize dScripts (#814) 2022-11-03 12:57:54 -05:00