From: michael Date: Wed, 11 Mar 2015 18:55:56 +0000 (+0000) Subject: - libopm.c: fixed an off by one in opm_callback() and libopm_do_callback() that poten... X-Git-Tag: 1.1.0beta1~136 X-Git-Url: http://git.serene-ircd.net/?a=commitdiff_plain;h=94c4872f0d998ccda7231b5106fa97682a6d1293;p=hopm.git - libopm.c: fixed an off by one in opm_callback() and libopm_do_callback() that potentially allowed to write to out-of-bounds memory git-svn-id: svn://svn.ircd-hybrid.org/svnroot/hopm/trunk@5673 82007160-df01-0410-b94d-b575c5fd34c7 --- diff --git a/src/libopm/src/libopm.c b/src/libopm/src/libopm.c index cc1c438..f5735f9 100644 --- a/src/libopm/src/libopm.c +++ b/src/libopm/src/libopm.c @@ -197,7 +197,7 @@ opm_remote_free(OPM_REMOTE_T *remote) OPM_ERR_T opm_callback(OPM_T *scanner, int type, OPM_CALLBACK_FUNC *function, void *data) { - if (type < 0 || type >= (CBLEN + 1)) + if (type < 0 || type >= CBLEN) return OPM_ERR_CBNOTFOUND; scanner->callbacks[type].func = function; @@ -1276,7 +1276,7 @@ static void libopm_do_callback(OPM_T *scanner, OPM_REMOTE_T *remote, int type, int var) { /* Callback is out of range */ - if (type < 0 || type >= (CBLEN + 1)) + if (type < 0 || type >= CBLEN) return; if (scanner->callbacks[type].func)