Skip to content

Commit

Permalink
OnClientDisconnect() always needs a valid user
Browse files Browse the repository at this point in the history
If a client disconnected before completing the authentication,
OnClientDisconnect() was called with m_pUser == NULL. This problem is new since
previously MODULECALL silently failed if it got a NULL.

Thanks to ex0a for repeatedly crashing his znc to figure this out. :-P

Signed-off-by: Uli Schlachter <psychon@znc.in>
  • Loading branch information
psychon committed Sep 11, 2011
1 parent 893a631 commit ff35970
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Client.cpp
Expand Up @@ -685,7 +685,9 @@ void CClient::Disconnected() {
DEBUG(GetSockName() << " == Disconnected()");
SetNetwork(NULL, true, false);

MODULECALL(OnClientDisconnect(), m_pUser, m_pNetwork, this, NOTHING);
if (m_pUser) {
MODULECALL(OnClientDisconnect(), m_pUser, m_pNetwork, this, NOTHING);
}
}

void CClient::ReachedMaxBuffer() {
Expand Down

0 comments on commit ff35970

Please sign in to comment.