pgsql: Avoid use of non-portable strnlen() in pgstat_clip_activity().

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Avoid use of non-portable strnlen() in pgstat_clip_activity().
Date: 2017-09-19 21:27:24
Message-ID: E1duQ3A-00031N-Pm@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Avoid use of non-portable strnlen() in pgstat_clip_activity().

The use of strnlen rather than strlen was just paranoia. Instead of
giving up on the paranoia, just implement the safeguard
differently. And add a comment explaining why we're careful.

Author: Andres Freund
Discussion: https://postgr.es/m/E1duOkJ-0001Mc-U5@gemulon.postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/71edbb6f66f7139d6209334ef8734a122ba06b56

Modified Files
--------------
src/backend/postmaster/pgstat.c | 25 +++++++++++++++++++++----
src/include/pgstat.h | 2 +-
2 files changed, 22 insertions(+), 5 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message pgsql 2017-09-19 22:01:41 pgsql: Tag refs/tags/REL_10_RC1 was created
Previous Message Tom Lane 2017-09-19 21:05:09 Re: pgsql: Speedup pgstat_report_activity by moving mb-aware truncation to