From 12629f8e94250f4ba1f2fa6ff7a2de4db1f279a8 Mon Sep 17 00:00:00 2001 From: psychon Date: Tue, 30 Mar 2010 12:06:27 +0000 Subject: [PATCH] Make sure CWebSock::GetSession() only generates one session When one sent a basic-auth header, OnLogin() was called with the request's data which caused a GetSession() call which generated a new session. Sadly, this session wasn't saved anywhere, so a new one session was generated later when OnPageRequest() triggered. This could lead to a NULL pointer dereference. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1857 726aef4b-f618-498e-8847-2d620e286838 --- WebModules.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/WebModules.cpp b/WebModules.cpp index 029444a4..cd10b86e 100644 --- a/WebModules.cpp +++ b/WebModules.cpp @@ -683,6 +683,8 @@ CSmartPtr CWebSock::GetSession() { CSmartPtr spSession(new CWebSession(sSessionID)); m_mspSessions.AddItem(spSession->GetId(), spSession); + m_spSession = spSession; + return spSession; }