summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-11 16:33:03 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-11 16:33:03 +0000
commit6d88dc05822d9a8df80927255272fe7c9c0447de (patch)
treef752b72fff77e33fcb16b7c6d48e9c7a84ff5f9f
parentfdfb7f82f786ca1c359b6a39415f2d2c192aa8b5 (diff)
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
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp5
-rw-r--r--src/modules/extra/m_ssl_openssl.cpp6
2 files changed, 9 insertions, 2 deletions
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;