diff options
author | om <om@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-03-09 03:01:11 +0000 |
---|---|---|
committer | om <om@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-03-09 03:01:11 +0000 |
commit | c3c2ee8055a5f170bf0034d29c2e7dc866f9e92b (patch) | |
tree | 48c2746a897a7fb290cc6c35d61e0a2318fe4e59 | |
parent | fe12fdb2a4a0add4a27556d0ccdc4d7166d6e45a (diff) |
Fix buffer overflow (visible in /mode #channel)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3577 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/helperfuncs.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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; } - |