From 6d88dc05822d9a8df80927255272fe7c9c0447de Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 11 Feb 2006 16:33:03 +0000 Subject: Added a sanity check that was left out, prevents crash on invalid fd (e.g. via excess flood on oper or connect) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3151 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_ssl_gnutls.cpp | 5 ++++- src/modules/extra/m_ssl_openssl.cpp | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src/modules') diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 50a751412..4ba95f4a1 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -525,7 +525,10 @@ class ModuleSSLGnuTLS : public Module // This will do for setting the ssl flag...it could be done earlier if it's needed. But this seems neater. userrec* extendme = Srv->FindDescriptor(session->fd); - extendme->Extend("ssl", "ON"); + if (extendme) + { + extendme->Extend("ssl", "ON"); + } // Change the seesion state session->status = ISSL_HANDSHAKEN; diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index 134efbe0c..3a0a01409 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -599,7 +599,11 @@ class ModuleSSLOpenSSL : public Module log(DEBUG, "m_ssl_openssl.so: Handshake completed"); // This will do for setting the ssl flag...it could be done earlier if it's needed. But this seems neater. - Srv->FindDescriptor(session->fd)->Extend("ssl", "ON"); + userrec* u = Srv->FindDescriptor(session->fd); + if (u) + { + u->Extend("ssl", "ON"); + } session->status = ISSL_OPEN; -- cgit v1.2.3