pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid 0-length memcpy to NULL with EXEC_BACKEND
Date: Wed, 03 Jul 2024 13:22:47 +0000
Message-ID: <E1sOzwc-0009z0-DO@gemulon.postgresql.org> (raw)

Avoid 0-length memcpy to NULL with EXEC_BACKEND

memcpy(NULL, src, 0) is forbidden by POSIX, even though every
production version of libc allows it. Let's be tidy.

Per report from Thomas Munro, running UBSan with EXEC_BACKEND.
Backpatch to v17, where this code was added.

Discussion: https://www.postgresql.org/message-id/CA%2BhUKG%2Be-dV7YWBzfBZXsgovgRuX5VmvmOT%2Bv0aXiZJ-EKbXcw@mail...

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/95219c020c3c8c59079f264386141065865a810e

Modified Files
--------------
src/backend/postmaster/launch_backend.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)



view thread (2+ messages)  latest in thread

Message-ID: <E1sOzwc-0009z0-DO@gemulon.postgresql.org>
Permalink:  ../E1sOzwc-0009z0-DO@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1sOzwc-0009z0-DO@gemulon.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-committers@postgresql.org
  Cc: heikki.linnakangas@iki.fi, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Avoid 0-length memcpy to NULL with EXEC_BACKEND
  In-Reply-To: <E1sOzwc-0009z0-DO@gemulon.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