pgsql: Avoid overflow in MaybeRemoveOldWalSummaries().

From: Nathan Bossart <nathan(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Avoid overflow in MaybeRemoveOldWalSummaries().
Date: 2024-03-20 18:34:30
Message-ID: E1rn0li-004otZ-2C@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Avoid overflow in MaybeRemoveOldWalSummaries().

This commit limits the maximum value of wal_summary_keep_time to
INT_MAX / SECS_PER_MINUTE to avoid overflow when it is converted to
seconds. In passing, use the HOURS_PER_DAY, MINS_PER_HOUR, and
SECS_PER_MINUTE macros in the code for this GUC instead of hard-
coding those values.

Discussion: https://postgr.es/m/20240314210010.GA3056455%40nathanxps13

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/80686761c49d5194d224b344e968c26981611726

Modified Files
--------------
src/backend/postmaster/walsummarizer.c | 4 ++--
src/backend/utils/misc/guc_tables.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2024-03-20 21:11:41 pgsql: Add to_regtypemod function to extract typemod from a string type
Previous Message Jeff Davis 2024-03-20 16:47:38 pgsql: Inline basic UTF-8 functions.