From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid unnecessary use of strncpy in a couple of places in ecpg.
Date: Sat, 16 Jun 2018 18:59:01 +0000
Message-ID: <E1fUGPd-0001JE-5n@gemulon.postgresql.org> (raw)
Avoid unnecessary use of strncpy in a couple of places in ecpg.
Use of strncpy with a length limit based on the source, rather than
the destination, is non-idiomatic and draws warnings from gcc 8.
Replace with memcpy, which does exactly the same thing in these cases,
but with less chance for confusion.
Backpatch to all supported branches.
Discussion: https://postgr.es/m/21789.1529170195@sss.pgh.pa.us
Branch
------
REL9_6_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/58065f9eed68fae83ddf98c8dff24ae8f0b62f0c
Modified Files
--------------
src/interfaces/ecpg/ecpglib/descriptor.c | 2 +-
src/interfaces/ecpg/pgtypeslib/common.c | 6 ++----
2 files changed, 3 insertions(+), 5 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: Avoid unnecessary use of strncpy in a couple of places in ecpg.
In-Reply-To: <E1fUGPd-0001JE-5n@gemulon.postgresql.org>
References: <E1fUGPd-0001JE-5n@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