From c64ea906b98ba22962b31316f6ea06cdd48e75b3 Mon Sep 17 00:00:00 2001 From: w00t Date: Mon, 25 Aug 2008 15:49:39 +0000 Subject: 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 --- src/users.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/users.cpp') 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; } -- cgit v1.2.3