mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Message: add bounds check in GetParamsColon when uIdx >= params.size()
Without this check, when uIdx >= m_vsParams.size() and the vector is non-empty, the subtraction in the clamp condition underflows to SIZE_MAX. GetParamsSplit() already has the equivalent check at the top of the function; this brings GetParamsColon() in line with it. Fixes #1994
This commit is contained in:
@@ -51,7 +51,7 @@ void CMessage::SetCommand(const CString& sCommand) {
|
||||
}
|
||||
|
||||
CString CMessage::GetParamsColon(unsigned int uIdx, unsigned int uLen) const {
|
||||
if (m_vsParams.empty() || uLen == 0) {
|
||||
if (m_vsParams.empty() || uLen == 0 || uIdx >= m_vsParams.size()) {
|
||||
return "";
|
||||
}
|
||||
if (uLen > m_vsParams.size() - uIdx - 1) {
|
||||
|
||||
Reference in New Issue
Block a user