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.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1603 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2009-08-20 17:01:33 +00:00
parent aacb639b3b
commit 0ee2fd7507
+4
View File
@@ -704,6 +704,10 @@ CChan* CUser::FindChan(const CString& sName) const {
}
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.