[ Patch to 7.4.X.]
authorBruce Momjian <bruce@momjian.us>
Sun, 25 Sep 2005 03:18:16 +0000 (03:18 +0000)
committerBruce Momjian <bruce@momjian.us>
Sun, 25 Sep 2005 03:18:16 +0000 (03:18 +0000)
commit05a311c8c5647cd441fa0451fdb02b0eee824e4c
tree68bc2148bbe67fde444c3c4f287eb164626001e3
parentffaec752e971a660d165927160029ddfe34dc255
[ Patch to 7.4.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