X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_chanhistory.cpp;h=0817311260e7a990f53c1562bff6bcb967133e57;hb=780dda83ba3857bc3c330d4b5d38bb251a9d879b;hp=4d74b65e00a4bfbefb54523adfa099115d915ab7;hpb=2fcb5ff4389a9a82d253acdff02a388ddcf14653;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_chanhistory.cpp b/src/modules/m_chanhistory.cpp index 4d74b65e0..081731126 100644 --- a/src/modules/m_chanhistory.cpp +++ b/src/modules/m_chanhistory.cpp @@ -63,18 +63,25 @@ class HistoryMode : public ParamMode > { std::string::size_type colon = parameter.find(':'); if (colon == std::string::npos) + { + source->WriteNumeric(Numerics::InvalidModeParameter(channel, this, parameter)); return MODEACTION_DENY; + } std::string duration(parameter, colon+1); if ((IS_LOCAL(source)) && ((duration.length() > 10) || (!IsValidDuration(duration)))) + { + source->WriteNumeric(Numerics::InvalidModeParameter(channel, this, parameter)); return MODEACTION_DENY; + } unsigned int len = ConvToInt(parameter.substr(0, colon)); unsigned int time = InspIRCd::Duration(duration); - if (len == 0) - return MODEACTION_DENY; - if (len > maxlines && IS_LOCAL(source)) + if (len == 0 || (len > maxlines && IS_LOCAL(source))) + { + source->WriteNumeric(Numerics::InvalidModeParameter(channel, this, parameter)); return MODEACTION_DENY; + } if (len > maxlines) len = maxlines; @@ -116,7 +123,7 @@ class ModuleChanHistory : public Module void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE { ConfigTag* tag = ServerInstance->Config->ConfValue("chanhistory"); - m.maxlines = tag->getInt("maxlines", 50, 1); + m.maxlines = tag->getUInt("maxlines", 50, 1); sendnotice = tag->getBool("notice", true); dobots = tag->getBool("bots", true); }