From ef3b8d4c374a3a38f0c9784c86da4a71c1e72de7 Mon Sep 17 00:00:00 2001 From: psychon Date: Fri, 26 Jun 2009 10:34:42 +0000 Subject: [PATCH] CNick: Fix bug in RemPerm() The following sequence triggered this bug: /mode +ov-o The deop called CNick::RemPerm('@') which removed the '@' from the list of perms via std::string::erase(). The bug was that erase() by default erases till the end of the string, but we only wanted to remove a single character. The fix is easy, just pass in '1' as a second parameter. :) Thanks to sp219 for finding and reporting this bug. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1547 726aef4b-f618-498e-8847-2d620e286838 --- Nick.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Nick.cpp b/Nick.cpp index 38f75737..43c82468 100644 --- a/Nick.cpp +++ b/Nick.cpp @@ -93,7 +93,7 @@ bool CNick::RemPerm(unsigned char uPerm) { return false; } - m_sChanPerms.erase(uPos); + m_sChanPerms.erase(uPos, 1); return true; }