From 5458e9684da2c5e20908b8bf3ffb9178212020d0 Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 19 Jul 2008 00:33:07 +0000 Subject: Crash fix from jackmcbarn, thanks, fixes bug #578 git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10035 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_jumpserver.cpp | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/modules/m_jumpserver.cpp b/src/modules/m_jumpserver.cpp index 424ea9438..161dfe2c3 100644 --- a/src/modules/m_jumpserver.cpp +++ b/src/modules/m_jumpserver.cpp @@ -13,9 +13,9 @@ #include "inspircd.h" -/* $ModDesc: Provides support for unreal-style SAPART command */ +/* $ModDesc: Provides support for the RPL_REDIR numeric */ -/** Handle /SAPART +/** Handle /JUMPSERVER */ class CommandJumpserver : public Command { @@ -62,22 +62,25 @@ class CommandJumpserver : public Command port = 0; redirect_to.clear(); - for (const char* n = parameters[2].c_str(); *n; n++) + if (parameters.size() >= 3) { - switch (*n) + for (const char* n = parameters[2].c_str(); *n; n++) { - case '+': - direction = true; - break; - case '-': - direction = false; - break; - case 'a': - redirect_all_immediately = direction; - break; - case 'n': - redirect_new_users = direction; - break; + switch (*n) + { + case '+': + direction = true; + break; + case '-': + direction = false; + break; + case 'a': + redirect_all_immediately = direction; + break; + case 'n': + redirect_new_users = direction; + break; + } } } -- cgit v1.2.3