all repos — openbox @ df0447ce6d57c6ece97e69fc0874595e4ac0ae75

openbox fork - make it a bit more like ryudo

watch for bad actions and contexts
Dana Jansens danakj@orodu.net
commit

df0447ce6d57c6ece97e69fc0874595e4ac0ae75

parent

f28550dc28608a7ad4dadaedbef21e09171d18fa

1 files changed, 8 insertions(+), 0 deletions(-)

jump to
M src/python.ccsrc/python.cc

@@ -101,6 +101,14 @@ if (!PyCallable_Check(func)) {

PyErr_SetString(PyExc_TypeError, "Invalid callback function."); return NULL; } + if(context < 0 || context >= MouseContext::NUM_MOUSE_CONTEXT) { + PyErr_SetString(PyExc_ValueError, "Invalid MouseContext"); + return NULL; + } + if(action < 0 || action >= MouseAction::NUM_MOUSE_ACTION) { + PyErr_SetString(PyExc_ValueError, "Invalid MouseAction"); + return NULL; + } if (!ob::openbox->bindings()->addButton(button, context, action, func)) {