X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_chanhistory.cpp;h=5f081d9decbb17a2b26debf16ad4e4f36702453d;hb=93fa544b2671b078cf81ac04fbb4b48d5e2d1677;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..5f081d9de 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;