fix: null-session crash on event start/end broadcast #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/null-session-broadcast-crash"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes a confirmed crash (symbolized backtrace from a captured coredump on the live server, two crashes in ~24h) caused by
ChatHandler(nullptr).SendWorldText(...)inStartEvent()/EndEvent().ChatHandler::SendWorldTextassumes a real session and callsGetSession()->SendPacket()unconditionally -- with a null session that is an immediate null-pointer crash.Replaced all three call sites with
sWorldSessionMgr->SendServerMessage(SERVER_MSG_STRING, text)-- the core-provided session-free broadcast path, same one the built-in.announceGM command uses.Crash backtrace for reference:
The
EndEvent()call site had not crashed yet but has the identical bug and would fail the first time any event completed naturally rather than being killed by the crash first.