From 94aeaa02bf4809ddd5f59627093a64fe4aeb875b Mon Sep 17 00:00:00 2001 From: jabberwock <88205+jabberwock@users.noreply.github.com> Date: Tue, 17 Mar 2026 08:52:33 -0700 Subject: [PATCH] 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 --- src/Message.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Message.cpp b/src/Message.cpp index 64fa7950..71369a7f 100644 --- a/src/Message.cpp +++ b/src/Message.cpp @@ -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) {