[PATCH v1] PL/Perl: Fix NULL deref for forged array

From: Xing Guo <higuoxing(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: [PATCH v1] PL/Perl: Fix NULL deref for forged array
Date: 2026-06-23 06:46:44
Message-ID: CACpMh+DYgcnqZwQLXXuxQcehJTd7T8UmKWSLsK4mFBEp9G2ajA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

A PL/Perl function returning a forged PostgreSQL::InServer::ARRAY
object (e.g., an empty hash blessed as that class) could cause a
segfault. This occurs because hv_fetch_string returns NULL pointer
when the "array" key is missing, and the code previously dereferenced
it without checking if the pointer itself was NULL.

The attachment is the patch for fixing it.

Best Regards,
Xing

Attachment Content-Type Size
v1-0001-PL-Perl-Fix-NULL-deref-for-forged-array.patch application/octet-stream 2.6 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Guo 2026-06-23 06:54:14 Re: Remove inner joins based on foreign keys
Previous Message Chengpeng Yan 2026-06-23 06:46:35 Re: Add a greedy join search algorithm to handle large join problems