diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-27 00:43:33 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-27 00:43:33 +0000 |
commit | 439843a2f3e57632924a3e77a7bb15f19a07ee7d (patch) | |
tree | ff2c55a0e4ea54d546aea3b94eec4fad5aee466a | |
parent | c7782ce7cc6f62e34020e3f652c78d48deb3012b (diff) |
Sometimes we were just doing Route->GetSock(), without first checking Route was non-null.
Instead, do "if (Route && Route->GetSock())" in a few places. This should make stuff water-tight
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5027 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/modules/m_spanningtree.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index 316d5b03d..78a1ebb04 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -3167,7 +3167,7 @@ bool DoOneToAllButSenderRaw(std::string data, std::string omit, std::string pref for (unsigned int x = 0; x < items; x++) { TreeServer* Route = TreeRoot->GetChild(x); - if ((Route->GetSocket()) && (Route->GetName() != omit) && (omitroute != Route)) + if ((Route) && (Route->GetSocket()) && (Route->GetName() != omit) && (omitroute != Route)) { TreeSocket* Sock = Route->GetSocket(); Sock->WriteLine(data); @@ -3193,7 +3193,7 @@ bool DoOneToAllButSender(std::string prefix, std::string command, std::deque<std // The route has a socket (its a direct connection) // The route isnt the one to be omitted // The route isnt the path to the one to be omitted - if ((Route->GetSocket()) && (Route->GetName() != omit) && (omitroute != Route)) + if ((Route) && (Route->GetSocket()) && (Route->GetName() != omit) && (omitroute != Route)) { TreeSocket* Sock = Route->GetSocket(); Sock->WriteLine(FullLine); @@ -3214,7 +3214,7 @@ bool DoOneToMany(std::string prefix, std::string command, std::deque<std::string for (unsigned int x = 0; x < items; x++) { TreeServer* Route = TreeRoot->GetChild(x); - if (Route->GetSocket()) + if (Route && Route->GetSocket()) { TreeSocket* Sock = Route->GetSocket(); Sock->WriteLine(FullLine); @@ -3248,7 +3248,7 @@ bool DoOneToOne(std::string prefix, std::string command, std::deque<std::string> { FullLine = FullLine + " " + params[x]; } - if (Route->GetSocket()) + if (Route && Route->GetSocket()) { TreeSocket* Sock = Route->GetSocket(); Sock->WriteLine(FullLine); |