From: Dana Jansens Date: Thu, 2 Jan 2003 22:53:52 +0000 (+0000) Subject: check for valid callback in bind() X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=54da8e404b0baa8b4521ce14c8eb9a28ea64e7f9;p=chaz%2Fopenbox check for valid callback in bind() --- diff --git a/src/openbox.i b/src/openbox.i index 0e98bbfd..c8236445 100644 --- a/src/openbox.i +++ b/src/openbox.i @@ -99,6 +99,10 @@ PyObject * unregister_all(int action) 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;