mirror of
https://github.com/znc/znc.git
synced 2026-08-02 06:52:51 +02:00
Fix some more unsafe substr() calls
All of these require at least a valid login to znc to cause a std::out_of_range exceptions, some might not even be exploitable! git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2095 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
+3
-11
@@ -154,7 +154,7 @@ public:
|
||||
|
||||
virtual void ReadLine(const CS_STRING & sLine)
|
||||
{
|
||||
if (sLine.substr(0, 5) == "From ")
|
||||
if (sLine.Left(5) == "From ")
|
||||
{
|
||||
if (!m_sMailBuffer.empty())
|
||||
{
|
||||
@@ -168,7 +168,7 @@ public:
|
||||
void ProcessMail()
|
||||
{
|
||||
EmailST tmp;
|
||||
tmp.sUidl = (char *)CMD5(m_sMailBuffer.substr(0, 255));
|
||||
tmp.sUidl = (char *)CMD5(m_sMailBuffer.Left(255));
|
||||
VCString vsLines;
|
||||
VCString::iterator it;
|
||||
|
||||
@@ -200,15 +200,7 @@ private:
|
||||
|
||||
void CEmail::OnModCommand(const CString& sCommand)
|
||||
{
|
||||
CString::size_type iPos = sCommand.find(" ");
|
||||
CString sCom, sArgs;
|
||||
if (iPos == CString::npos)
|
||||
sCom = sCommand;
|
||||
else
|
||||
{
|
||||
sCom = sCommand.substr(0, iPos);
|
||||
sArgs = sCommand.substr(iPos + 1, CString::npos);
|
||||
}
|
||||
CString sCom = sCommand.Token(0);
|
||||
|
||||
if (sCom == "timers")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user