pgsql: Use strlcpy instead of memcpy for copying the slot name in pgsta

From: Amit Kapila <akapila(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Use strlcpy instead of memcpy for copying the slot name in pgsta
Date: 2020-11-06 02:51:25
Message-ID: E1karqX-0007m0-KQ@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Use strlcpy instead of memcpy for copying the slot name in pgstat.c.

There is no outright bug here but it is better to be consistent with the
usage at other places in the same file. In the passing, fix a wrong
assertion in pgstat_recv_replslot.

Author: Kyotaro Horiguchi
Reviewed-by: Sawada Masahiko and Amit Kapila
Discussion: https://postgr.es/m/20201104.175523.1704166915688949637.horikyota.ntt@gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4f841ce3f7f4d429a3a275f82745d63c78cde4b2

Modified Files
--------------
src/backend/postmaster/pgstat.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Magnus Hagander 2020-11-06 12:31:46 pgsql: Add pg_strong_random_init function to initialize random number g
Previous Message Peter Geoghegan 2020-11-05 23:02:35 pgsql: Fix wal_consistency_checking nbtree bug.