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: Fix copying SockAddr struct
Date: Tue, 12 Mar 2024 13:35:36 +0000
Message-ID: <E1rk2I3-003QMg-W1@gemulon.postgresql.org> (raw)

Fix copying SockAddr struct

Valgrind alerted about accessing uninitialized bytes after commit
4945e4ed4a:

==700242== VALGRINDERROR-BEGIN
==700242== Conditional jump or move depends on uninitialised value(s)
==700242==    at 0x6D8A2A: getnameinfo_unix (ip.c:253)
==700242==    by 0x6D8BD1: pg_getnameinfo_all (ip.c:122)
==700242==    by 0x4B3EB6: BackendInitialize (postmaster.c:4266)
==700242==    by 0x4B684E: BackendStartup (postmaster.c:4114)
==700242==    by 0x4B6986: ServerLoop (postmaster.c:1780)
==700242==    by 0x4B80CA: PostmasterMain (postmaster.c:1478)
==700242==    by 0x3F7424: main (main.c:197)
==700242==  Uninitialised value was created by a stack allocation
==700242==    at 0x4B6934: ServerLoop (postmaster.c:1737)
==700242==
==700242== VALGRINDERROR-END

That was because the SockAddr struct was not copied correctly.

Per buildfarm animal "skink".

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/cb9663e20dc2ddc904660d12638f6c82af7b420e

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



view thread (7+ messages)

Message-ID: <E1rk2I3-003QMg-W1@gemulon.postgresql.org>
Permalink:  ../E1rk2I3-003QMg-W1@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rk2I3-003QMg-W1@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: Fix copying SockAddr struct
  In-Reply-To: <E1rk2I3-003QMg-W1@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