Re: Potential null pointer dereference in postgres.c

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Karina Litskevich <litskevichkarina(at)gmail(dot)com>
Cc: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Potential null pointer dereference in postgres.c
Date: 2024-12-05 17:23:14
Message-ID: 2545009.1733419394@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Karina Litskevich <litskevichkarina(at)gmail(dot)com> writes:
> When backporting 66e94448 to older versions it was forgotten to check
> malloc() result. In 16+ versions guc_malloc() is used to allocate
> memory and it checks if the result pointer is NULL, so there is no
> need to check it after guc_malloc(). Versions before 16 have no
> guc_malloc(), and malloc() is used instead, but we have to check if
> return value is NULL.

Yup, you're right. Thanks for the report!

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2024-12-05 17:37:02 Re: postgres_fdw: Provide better emulation of READ COMMITTED behavior
Previous Message Alvaro Herrera 2024-12-05 17:08:08 Re: [Bug] Heap Use After Free in Window Aggregate Execution