diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-08-25 15:49:39 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-08-25 15:49:39 +0000 |
commit | c64ea906b98ba22962b31316f6ea06cdd48e75b3 (patch) | |
tree | 8135eb8a3c088190838b2559ae390d8b8de4370d /src | |
parent | 56f500b2c916d8801daaa631cd9215263bb3de23 (diff) |
Bounds checking on IsModeSet, etc, to stop silly problems
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10282 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/users.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/users.cpp b/src/users.cpp index 943503ff1..a98adb044 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -116,11 +116,15 @@ void User::StartDNSLookup() bool User::IsNoticeMaskSet(unsigned char sm) { + if (!isalpha(sm)) + return false; return (snomasks[sm-65]); } void User::SetNoticeMask(unsigned char sm, bool value) { + if (!isalpha(sm)) + return; snomasks[sm-65] = value; } @@ -139,15 +143,17 @@ const char* User::FormatNoticeMasks() return data; } - - bool User::IsModeSet(unsigned char m) { + if (!isalpha(m)) + return false; return (modes[m-65]); } void User::SetMode(unsigned char m, bool value) { + if (!isalpha(m)) + return; modes[m-65] = value; } |