From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix portability and safety issues in pqTraceFormatTimestamp.
Date: Wed, 31 Mar 2021 21:04:00 +0000
Message-ID: <E1lRi0O-0003vA-Df@gemulon.postgresql.org> (raw)
Fix portability and safety issues in pqTraceFormatTimestamp.
Remove confusion between time_t and pg_time_t; neither
gettimeofday() nor localtime() deal in the latter.
libpq indeed has no business using <pgtime.h> at all.
Use snprintf not sprintf, to ensure we can't overrun the
supplied buffer. (Unlikely, but let's be safe.)
Per buildfarm.
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/f1be740a991406d7885047beb971e1ff5dbe8b71
Modified Files
--------------
src/interfaces/libpq/fe-trace.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Fix portability and safety issues in pqTraceFormatTimestamp.
In-Reply-To: <E1lRi0O-0003vA-Df@gemulon.postgresql.org>
References: <E1lRi0O-0003vA-Df@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