From c8ff7ca97feb5f74629f3c988c63fe65e7a47637 Mon Sep 17 00:00:00 2001 From: nenolod Date: Fri, 9 Feb 2007 14:18:23 -0800 Subject: [PATCH] [svn] - fix off-by-one memory overflow error. --- ChangeLog | 15 +++++++++++++++ include/serno.h | 2 +- libcharybdis/kqueue.c | 8 ++------ 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index e49746ea6..bef79f4f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +jilles 2007/02/04 15:08:04 UTC (20070204-3203) + Log: + Change handling of modularized umodes: + - keep the bitmask reserved forever to the letter, fixing + the problems when loading multiple umode modules, + unloading them and then loading them in a different order + - don't allow local users to change umodes which have + been unloaded and don't set them on new users via + default_umodes + + + Changes: Modified: + +24 -3 trunk/src/s_user.c (File Modified) + + jilles 2007/02/04 01:59:38 UTC (20070204-3201) Log: Move find_umode_slot() from libcharybdis/tools.c to src/s_user.c. diff --git a/include/serno.h b/include/serno.h index f52372adb..c78202f3f 100644 --- a/include/serno.h +++ b/include/serno.h @@ -1 +1 @@ -#define SERNO "20070204-3201" +#define SERNO "20070204-3203" diff --git a/libcharybdis/kqueue.c b/libcharybdis/kqueue.c index e9fced47b..327ca9fec 100644 --- a/libcharybdis/kqueue.c +++ b/libcharybdis/kqueue.c @@ -22,7 +22,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: kqueue.c 398 2005-12-12 18:12:46Z nenolod $ + * $Id: kqueue.c 3205 2007-02-09 22:18:23Z nenolod $ */ #include "stdinc.h" @@ -103,7 +103,7 @@ kq_update_events(fde_t * F, short filter, PF * handler) EV_SET(kep, (uintptr_t) F->fd, filter, kep_flags, 0, 0, (void *) F); - if(kqoff == kqmax) + if(++kqoff == kqmax) { int ret; @@ -116,10 +116,6 @@ kq_update_events(fde_t * F, short filter, PF * handler) } kqoff = 0; } - else - { - kqoff++; - } } }