mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
When you are already in #znc and you did 'stick znc' (# prefix missing!), stickychan caused segfaults or different weird behavior. This happened because stickychan didn't handle errors from CUser::AddChan(). AddChan() can only error out if the channel already exists, but since stickychan already checked this, were does the error come from? CChan's constructor does some sanity checks on the channel name. It automatically adds the proper channel prefix (most likely #) if it's missing. This means when stickychan checked for the channel "znc" it correctly didn't find one. When it then tried to add "znc", it really tried adding "#znc" which could fail if the channel was already added. Thanks to DM8Mydog for finding this. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1500 726aef4b-f618-498e-8847-2d620e286838