summaryrefslogtreecommitdiff
path: root/src/configreader.cpp
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-07-20 08:53:56 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-07-20 08:53:56 +0000
commitca781714c1651a9e7042eb930c6b117449f8e1fc (patch)
tree626d56d3997cfffcfaecf8461ed6cfceed74b200 /src/configreader.cpp
parent2d4a319d961e3f9e6aa9f7926f9ed320d72de8da (diff)
Fixes to some stuff that writes on memory it shouldn't (thanks psychon).
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10047 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/configreader.cpp')
-rw-r--r--src/configreader.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp
index a302dd6ea..117546f09 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -301,7 +301,7 @@ bool InitializeDisabledCommands(const char* data, InspIRCd* ServerInstance)
bool ValidateDisabledUModes(ServerConfig* conf, const char*, const char*, ValueItem &data)
{
- memset(conf->DisabledUModes, 0, 64);
+ memset(conf->DisabledUModes, 0, sizeof(conf->DisabledUModes));
for (const unsigned char* p = (const unsigned char*)data.GetString(); *p; ++p)
{
if (*p < 'A' || *p > ('A' + 64)) throw CoreException(std::string("Invalid usermode ")+(char)*p+" was found.");
@@ -312,7 +312,7 @@ bool ValidateDisabledUModes(ServerConfig* conf, const char*, const char*, ValueI
bool ValidateDisabledCModes(ServerConfig* conf, const char*, const char*, ValueItem &data)
{
- memset(conf->DisabledCModes, 0, 64);
+ memset(conf->DisabledCModes, 0, sizeof(conf->DisabledCModes));
for (const unsigned char* p = (const unsigned char*)data.GetString(); *p; ++p)
{
if (*p < 'A' || *p > ('A' + 64)) throw CoreException(std::string("Invalid chanmode ")+(char)*p+" was found.");
@@ -414,7 +414,7 @@ bool ValidateRules(ServerConfig* conf, const char*, const char*, ValueItem &data
bool ValidateModeLists(ServerConfig* conf, const char*, const char*, ValueItem &data)
{
- memset(conf->HideModeLists, 0, 256);
+ memset(conf->HideModeLists, 0, sizeof(conf->HideModeLists));
for (const unsigned char* x = (const unsigned char*)data.GetString(); *x; ++x)
conf->HideModeLists[*x] = true;
return true;
@@ -422,7 +422,7 @@ bool ValidateModeLists(ServerConfig* conf, const char*, const char*, ValueItem &
bool ValidateExemptChanOps(ServerConfig* conf, const char*, const char*, ValueItem &data)
{
- memset(conf->ExemptChanOps, 0, 256);
+ memset(conf->ExemptChanOps, 0, sizeof(conf->ExemptChanOps));
for (const unsigned char* x = (const unsigned char*)data.GetString(); *x; ++x)
conf->ExemptChanOps[*x] = true;
return true;