diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-07-19 00:33:07 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-07-19 00:33:07 +0000 |
commit | 5458e9684da2c5e20908b8bf3ffb9178212020d0 (patch) | |
tree | dfb82dfc910687248eb72f23dfce4f05af84f5fe | |
parent | 5750ab5723389af0babfbb23f54343f4b10fbc1b (diff) |
Crash fix from jackmcbarn, thanks, fixes bug #578
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10035 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/modules/m_jumpserver.cpp | 35 |
1 files changed, 19 insertions, 16 deletions
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; + } } } |