2c65939788b9739d86047937725481050348d3f3
SubscriptionManager::processCommand()'s "invite" branch looked up its target via getSessionByAlias(&invitee), where invitee is a std::string local to that function call. getSessionByAlias(void*) compares by pointer identity against each session's own alias - the address of a brand-new local variable can never equal any of those, so the lookup was guaranteed to return NULL every time, and the result was dereferenced unconditionally right after. Any client sending a bare "invite:" command crashed the entire process, not just its own connection - same class of bug as the two GuildManager crashes fixed earlier this session, just found afterward while documenting this file's own mechanics. This generic ServerCore layer has no name-based session lookup available (that only exists as a Zephora-specific addition on top of TCPServer), so this stops the crash with a null check rather than attempting a real name-based fix, which would need a larger change. Also includes this file's pending brace-style reformat (K&R -> Allman) that was sitting uncommitted before this fix - bundled in rather than left stranded, no functional change from that part.
Description
This repository provides core functionality for TCP and UDP servers using the epoll linux function.
184 MiB
0 Stars
1 Watchers
0 Forks
Languages
C++
99.6%
Shell
0.4%