From 136a62707bfe67a99458ad67f8c9c8770a3b3708 Mon Sep 17 00:00:00 2001 From: psychon Date: Sun, 25 Jan 2009 15:33:47 +0000 Subject: [PATCH] savebuff: substr() could throw an exception, use Left() instead git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1347 726aef4b-f618-498e-8847-2d620e286838 --- modules/savebuff.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/savebuff.cpp b/modules/savebuff.cpp index a22bae73..05da739d 100644 --- a/modules/savebuff.cpp +++ b/modules/savebuff.cpp @@ -304,7 +304,7 @@ private: CBlowfish c(m_sPassword, BF_DECRYPT); sBuffer = c.Crypt(sFile); - if (sBuffer.substr(0, strlen(CRYPT_VERIFICATION_TOKEN)) != CRYPT_VERIFICATION_TOKEN) + if (sBuffer.Left(strlen(CRYPT_VERIFICATION_TOKEN)) != CRYPT_VERIFICATION_TOKEN) { // failed to decode :( PutModule("Unable to decode Encrypted file [" + sChannel + "]");