Backpatch to 8.0.X:
authorBruce Momjian <bruce@momjian.us>
Fri, 23 Sep 2005 21:02:37 +0000 (21:02 +0000)
committerBruce Momjian <bruce@momjian.us>
Fri, 23 Sep 2005 21:02:37 +0000 (21:02 +0000)
commit556135affc13cfe5dfa23a908d361ed319a745fa
tree8220ba1a59bdab1b13248a0ce364197822d3bde5
parent70135388c74c737e0ec08d5990a2a59bdc81b3af
Backpatch to 8.0.X:

In several places PL/Python was calling PyObject_Str() and then
PyString_AsString() without checking if the former had returned
NULL to indicate an error.  PyString_AsString() doesn't expect a
NULL argument, so passing one causes a segmentation fault.  This
patch adds checks for NULL and raises errors via PLy_elog(), which
prints details of the underlying Python exception.  The patch also
adds regression tests for these checks.  All tests pass on my
Solaris 9 box running HEAD and Python 2.4.1.
src/pl/plpython/plpython.c