Re: [PATCH] bms_prev_member() can read beyond the end of the array of allocated words

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: Greg Burd <greg(at)burd(dot)me>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] bms_prev_member() can read beyond the end of the array of allocated words
Date: 2025-08-14 14:06:40
Message-ID: 131108.1755180400@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

David Rowley <dgrowleyml(at)gmail(dot)com> writes:
> There's a comment saying:
> * "prevbit" must NOT be more than one above the highest possible bit that can
> * be set at the Bitmapset at its current size.
> So looks like it's the fault of the calling code and not an issue with
> bms_prev_member().

Yeah. But perhaps it'd be reasonable to put in an Assert checking
that?

Grammar nitpick: comment should be more like "set in the Bitmapset".

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2025-08-14 14:11:33 Re: Compilation issues for HASH_STATISTICS and HASH_DEBUG options
Previous Message Tom Lane 2025-08-14 14:04:17 Re: Compilation issues for HASH_STATISTICS and HASH_DEBUG options