public inbox for [email protected]
help / color / mirror / Atom feedFrom: Daniel Gustafsson <[email protected]>
To: Oleg Tselebrovskiy <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: BRIN integer overflow
Date: Wed, 21 Feb 2024 11:31:36 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
> On 21 Feb 2024, at 06:40, Oleg Tselebrovskiy <[email protected]> wrote:
> Function bringetbitmap that is used in BRIN's IndexAmRoutine should return an
> int64 value, but the actual return value is int, since totalpages is int and
> totalpages * 10 is also int. This could lead to integer overflow
(totalpages * 10) overflowing an int seems like a quite theoretical risk which
would be hard to hit in practice.
> I suggest to change totalpages to be int64 to avoid potential overflow.
> Also in all other "amgetbitmap functions" (such as hashgetbitmap, gistgetbitmap,
> gingetbitmap, blgetbitmap) the return value is of correct int64 type
That being said, changing it like this seems reasonable since the API is
defined as int64, and it will keep static analyzers quiet.
--
Daniel Gustafsson
view thread (2+ messages)
reply
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: [email protected]
Cc: [email protected], [email protected]
Subject: Re: BRIN integer overflow
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox