pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: dan-eli@mail.ru
Subject: BUG #18797: pointer te->defn not checked for NULL
Date: Thu, 06 Feb 2025 11:28:22 +0000
Message-ID: <18797-e48e5e7be4954d72@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      18797
Logged by:          Daniel Elishakov
Email address:      dan-eli@mail.ru
PostgreSQL version: 16.6
Operating system:   ubuntu 20.04
Description:        

src/interfaces/ecpg/pgtypeslib/dt_common.c:2662
src/interfaces/ecpg/pgtypeslib/dt_common.c:2787
src/interfaces/ecpg/pgtypeslib/dt_common.c:2795
src/interfaces/ecpg/pgtypeslib/dt_common.c:2840
in function PGTYPEStimestamp_defmt_scan there is a usage of pgtypes_alloc().
In other functions the result of pgtypes_alloc is being checked for NULL.
For example, in /src/interfaces/ecpg/pgtypeslib/numeric.c. I think in
PGTYPEStimestamp_defmt_scan it is also worth checking for NULL before
dereferencing in strcpy, because PGTYPEStimestamp_defmt_scan is being called
recursively and if there won't be any available memory to allocate, it can
be a real problem in terms of data consistency.



view thread (2+ messages)  latest in thread

Message-ID: <18797-e48e5e7be4954d72@postgresql.org>
Permalink:  ../18797-e48e5e7be4954d72@postgresql.org/
Also on:    postgresql.org/message-id/18797-e48e5e7be4954d72@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, dan-eli@mail.ru
  Subject: Re: BUG #18797: pointer te->defn not checked for NULL
  In-Reply-To: <18797-e48e5e7be4954d72@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox