From: <ps...@us...> - 2009-08-20 17:01:45
|
Revision: 1603 http://znc.svn.sourceforge.net/znc/?rev=1603&view=rev Author: psychon Date: 2009-08-20 17:01:33 +0000 (Thu, 20 Aug 2009) Log Message: ----------- Fix a division by zero bug Thanks to Sickness for reporting this and providing backtraces and for flakes for writing a first patch that Sickness tested. Modified Paths: -------------- trunk/User.cpp Modified: trunk/User.cpp =================================================================== --- trunk/User.cpp 2009-08-17 20:00:09 UTC (rev 1602) +++ trunk/User.cpp 2009-08-20 17:01:33 UTC (rev 1603) @@ -704,6 +704,10 @@ } void CUser::JoinChans() { + // Avoid divsion by zero, it's bad! + if (m_vChans.size() == 0) + return; + // We start at a random offset into the channel list so that if your // first 3 channels are invite-only and you got MaxJoins == 3, ZNC will // still be able to join the rest of your channels. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |