From: | Michael Paquier <michael(at)paquier(dot)xyz> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Fix memory overrun when querying pg_stat_slru |
Date: | 2021-11-12 12:51:36 |
Message-ID: | E1mlW1o-00072L-J1@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Fix memory overrun when querying pg_stat_slru
pg_stat_get_slru() in pgstatfuncs.c would point to one element after the
end of the array PgStat_SLRUStats when finishing to scan its entries.
This had no direct consequences as no data from the extra memory area
was read, but static analyzers would rightfully complain here. So let's
be clean.
While on it, this adds one regression test in the area reserved for
system views.
Reported-by: Alexander Kozhemyakin, via AddressSanitizer
Author: Kyotaro Horiguchi
Discussion: https://postgr.es/m/17280-37da556e86032070@postgresql.org
Backpatch-through: 13
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/a45ed975c58fde7303eeae488b313bf0314383f7
Modified Files
--------------
src/backend/utils/adt/pgstatfuncs.c | 3 ++-
src/test/regress/expected/sysviews.out | 7 +++++++
src/test/regress/sql/sysviews.sql | 3 +++
3 files changed, 12 insertions(+), 1 deletion(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Eisentraut | 2021-11-12 13:16:25 | Re: pgsql: Remove check for accept() argument types |
Previous Message | Noah Misch | 2021-11-12 01:17:17 | pgsql: Report any XLogReadRecord() error in XlogReadTwoPhaseData(). |