Re: plpython: NULL pointer dereference on broken sequence objects - Mailing list pgsql-hackers

From Richard Guo
Subject Re: plpython: NULL pointer dereference on broken sequence objects
Date
Msg-id CAMbWs4_beAx9kD4NqX3j70TaMVkpSG57y+_barFF2hGUK3yeBA@mail.gmail.com
Whole thread
Responses Re: plpython: NULL pointer dereference on broken sequence objects
List pgsql-hackers
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.

- Richard

Attachment

pgsql-hackers by date:

Previous
From: vignesh C
Date:
Subject: Re: Proposal: Conflict log history table for Logical Replication
Next
From: Richard Guo
Date:
Subject: Re: Add enable_groupagg GUC parameter to control GroupAggregate usage