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

Поиск
Список
Период
Сортировка
Искать

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

От:
Richard Guo <guofenglinux@gmail.com>
Дата:
On Tue, Jun 23, 2026 at 3:47 PM Xing Guo  wrote:
> 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.

+1.  Good catch.  Every other caller of hv_fetch_string checks the
returned pointer.  This is the only place missing that safety check.

- Richard


FAQ