From c3c2ee8055a5f170bf0034d29c2e7dc866f9e92b Mon Sep 17 00:00:00 2001 From: om Date: Thu, 9 Mar 2006 03:01:11 +0000 Subject: Fix buffer overflow (visible in /mode #channel) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3577 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/helperfuncs.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index 7c0d37196..fb5b88449 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -1310,9 +1310,10 @@ char* chanmodes(chanrec *chan, bool showkey) strlcat(sparam,foo,MAXBUF); } - for (int n = 0; n < 190; n++) + /* This was still iterating up to 190, chanrec::custom_modes is only 64 elements -- Om */ + for(int n = 0; n < 64; n++) { - if (chan->custom_modes[n]) + if(chan->custom_modes[n]) { *offset++ = n+65; std::string extparam = chan->GetModeParameter(n+65); @@ -1796,4 +1797,3 @@ bool charremove(char* mp, char remove) return shift_down; } - -- cgit v1.2.3