GNOME Bugzilla – Bug 678338
Unchecked return value
Last modified: 2014-08-22 19:36:12 UTC
While investigating Python 3 support, I noticed a few minor issues where return values are not checked for errors. In practice these may never occur, but to be safe, it's best to check and handle these possible errors. in peas-plugin-loader-python.c, in peas_plugin_loader_python_initialize(), after the PyErr_Occurred() check on line 407, you can potentially get errors in the following calls: PyModule_GetDict(), PyDict_GetItemString() Py_BuildValue() PyObject_CallObject() PyEval_SafeThread() These all fall straight through to the `return TRUE`, so unless the caller is checking for PyErr_Occurred(), failures will cause mysterious exceptions far from the failing call site. Other cases occur in peas_plugin_loader_python_add_module_path() such as the call to PySys_GetObject(), Py{String,Unicode}_FromString(), and PyList_Insert(). Also in peas_plugin_loader_python_create_extension(), unchecked are PyObject_SetAttrString(). There may be other cases I've missed.
Created attachment 279482 [details] [review] Bug 678338 - Check return values from Python API
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.