From 280f52aeae72a3383e1e10b2f2a5952e7b1413b7 Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 12 Dec 2005 12:44:43 +0000 Subject: *EXPERIMENTAL* Tied DNS into new socket engine git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2331 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/socketengine.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/socketengine.cpp') diff --git a/src/socketengine.cpp b/src/socketengine.cpp index 23088edb9..f19a8d082 100644 --- a/src/socketengine.cpp +++ b/src/socketengine.cpp @@ -40,12 +40,16 @@ SocketEngine::~SocketEngine() char SocketEngine::GetType(int fd) { + if ((fd < 0) || (fd > 65535)) + return X_EMPTY_SLOT; /* Mask off the top bit used for 'read/write' state */ return (ref[fd] & ~0x80); } bool SocketEngine::AddFd(int fd, bool readable, char type) { + if ((fd < 0) || (fd > 65535)) + return false; this->fds.push_back(fd); ref[fd] = type; if (readable) @@ -79,6 +83,10 @@ return true; bool SocketEngine::DelFd(int fd) { log(DEBUG,"SocketEngine::DelFd(%d)",fd); + + if ((fd < 0) || (fd > 65535)) + return false; + bool found = false; for (std::vector::iterator i = fds.begin(); i != fds.end(); i++) { -- cgit v1.2.3