Missing NULL check after calling ecpg_strdup

From: Evgeniy Gorbanev <gorbanyoves(at)basealt(dot)ru>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Missing NULL check after calling ecpg_strdup
Date: 2025-07-11 10:27:59
Message-ID: a6b193c1-6994-4d9c-9059-aca4aaf41ddd@basealt.ru
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi!

In case of out_of_memory, the ecpg_strdup function may return NULL.
Checks should be added in src/interfaces/ecpg/ecpglib/execute.c.
Patch attached.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

--
Best regards,
Evgeniy  Gorbanev

Attachment Content-Type Size
ecpglib-execute-check-ecpg_strdup.patch text/x-patch 1.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mircea Cadariu 2025-07-11 10:42:44 Re: analyze-in-stages post upgrade questions
Previous Message Konstantin Knizhnik 2025-07-11 10:27:26 Re: Logical replication prefetch