check for valid callback in bind()
Dana Jansens danakj@orodu.net
1 files changed,
4 insertions(+),
0 deletions(-)
jump to
M
src/openbox.i
→
src/openbox.i
@@ -99,6 +99,10 @@ }
PyObject * bind(PyObject *keylist, PyObject *func) { + if (!PyCallable_Check(func)) { + PyErr_SetString(PyExc_TypeError, "Invalid callback function."); + return NULL; + } if (!PyList_Check(keylist)) { PyErr_SetString(PyExc_TypeError, "Invalid keylist. Not a list."); return NULL;