From: Michael Paquier <michael@paquier.xyz>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: a.kozhemyakin@postgrespro.ru
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17280: global-buffer-overflow on select from pg_stat_slru
Date: Thu, 11 Nov 2021 11:52:27 +0900
Message-ID: <YYyFawH87Sv3VZGi@paquier.xyz> (raw)
In-Reply-To: <20211111.103923.2138998724021170559.horikyota.ntt@gmail.com>
References: <17280-37da556e86032070@postgresql.org>
<20211111.103923.2138998724021170559.horikyota.ntt@gmail.com>
On Thu, Nov 11, 2021 at 10:39:23AM +0900, Kyotaro Horiguchi wrote:
> The loop is designed not to directly rely on SRLU_NUM_ELEMENTS so if
> we honor that design, we would take the first or the third way. The
> first way is smallest but I prefer the third way as it is
> straightforward as such kind of loops. The attached is that for the
> master.
>
> The code was introduced at 13 and the attached applies to the versions
> back to 13.
Or it would be easier for the reader to assign stat after checking for
the result of pgstat_slru_name(), no? I am not much a fan of this
code style that uses a counter, FWIW, but at the same time
SLRU_NUM_ELEMENTS is local to pgstat.c, so..
--
Michael
Attachments:
[application/pgp-signature] signature.asc (832B, ../YYyFawH87Sv3VZGi@paquier.xyz/2-signature.asc)
download
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: michael@paquier.xyz, horikyota.ntt@gmail.com, a.kozhemyakin@postgrespro.ru, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17280: global-buffer-overflow on select from pg_stat_slru
In-Reply-To: <YYyFawH87Sv3VZGi@paquier.xyz>
* 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