Re: plpython: NULL pointer dereference on broken sequence objects
Ayush Tiwari <ayushtiwari.slg01@gmail.com>
From: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
To: Richard Guo <guofenglinux@gmail.com>
Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-06-26T07:22:37Z
Lists: pgsql-hackers
Hi, On Fri, 26 Jun 2026 at 11:35, Richard Guo <guofenglinux@gmail.com> wrote: > On Thu, Jun 25, 2026 at 10:05 PM Ayush Tiwari > <ayushtiwari.slg01@gmail.com> wrote: > > I think there's a similar problem on the mapping side that v1 doesn't > > cover. PLyMapping_ToJsonbValue and the hstore equivalent fetch items with > > PyMapping_Items() and PyList_GetItem() without checking for NULL, and a > > mapping whose items() raises still would crash the backend. > > Right. Those functions have the same issue as PySequence_GetItem(). > The attached v2 patch fixes them all. > Thanks for the update! v2 LGTM. Regards, Ayush
Commits
-
plpython: Fix NULL pointer dereferences for broken sequence and mapping objects
- 0b7719f744e6 14 (unreleased) landed
- 12bff46ff3eb 15 (unreleased) landed
- e92f23bde60e 16 (unreleased) landed
- 3dc59c1737d2 17 (unreleased) landed
- 53482fcb94a8 18 (unreleased) landed
- 8612f0b7ce09 19 (unreleased) landed