Re: Potential null pointer dereference in postgres.c - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Potential null pointer dereference in postgres.c
Date
Msg-id 2545009.1733419394@sss.pgh.pa.us
Whole thread Raw
List pgsql-hackers
Karina Litskevich <litskevichkarina@gmail.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



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [Bug] Heap Use After Free in Window Aggregate Execution
Next
From: Robert Haas
Date:
Subject: Re: postgres_fdw: Provide better emulation of READ COMMITTED behavior