]> Dogcows Code - chaz/openbox/commitdiff
check for valid callback in bind()
authorDana Jansens <danakj@orodu.net>
Thu, 2 Jan 2003 22:53:52 +0000 (22:53 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 2 Jan 2003 22:53:52 +0000 (22:53 +0000)
src/openbox.i

index 0e98bbfd49e63946da1213c6ee92908752531f2d..c82364452807907df62ef345bea326bde8cce96c 100644 (file)
@@ -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;
This page took 0.022309 seconds and 4 git commands to generate.