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

Поиск
Список
Период
Сортировка
Искать
От
Greg Burd
Тема
Re: [PATCH] bms_prev_member() can read beyond the end of the array of allocated words
Дата
Msg-id
833EA934-B153-4929-90DF-97DE49887932@getmailspring.com
Ответ на
Список
Дерево обсуждения
[PATCH] bms_prev_member() can read beyond the end of the array of allocated words Greg Burd <greg@burd.me>
Re: [PATCH] bms_prev_member() can read beyond the end of the array of allocated words David Rowley <dgrowleyml@gmail.com>
Re: [PATCH] bms_prev_member() can read beyond the end of the array of allocated words Tom Lane <tgl@sss.pgh.pa.us>
Re: [PATCH] bms_prev_member() can read beyond the end of the array of allocated words Greg Burd <greg@burd.me>
Re: [PATCH] bms_prev_member() can read beyond the end of the array of allocated words David Rowley <dgrowleyml@gmail.com>
Re: [PATCH] bms_prev_member() can read beyond the end of the array of allocated words Tom Lane <tgl@sss.pgh.pa.us>
Re: [PATCH] bms_prev_member() can read beyond the end of the array of allocated words Greg Burd <greg@burd.me>
Re: [PATCH] bms_prev_member() can read beyond the end of the array of allocated words Greg Burd <greg@burd.me>
Re: [PATCH] bms_prev_member() can read beyond the end of the array of allocated words Tom Lane <tgl@sss.pgh.pa.us>
Re: [PATCH] bms_prev_member() can read beyond the end of the array of allocated words David Rowley <dgrowleyml@gmail.com>
Re: [PATCH] bms_prev_member() can read beyond the end of the array of allocated words Greg Burd <greg@burd.me>
Re: [PATCH] bms_prev_member() can read beyond the end of the array of allocated words David Rowley <dgrowleyml@gmail.com>
Re: [PATCH] bms_prev_member() can read beyond the end of the array of allocated words Greg Burd <greg@burd.me>
Re: [PATCH] bms_prev_member() can read beyond the end of the array of allocated words Tom Lane <tgl@sss.pgh.pa.us>
Re: [PATCH] bms_prev_member() can read beyond the end of the array of allocated words Greg Burd <greg@burd.me>
Re: [PATCH] bms_prev_member() can read beyond the end of the array of allocated words David Rowley <dgrowleyml@gmail.com>
Re: [PATCH] bms_prev_member() can read beyond the end of the array of allocated words Tom Lane <tgl@sss.pgh.pa.us>
Re: [PATCH] bms_prev_member() can read beyond the end of the array of allocated words David Rowley <dgrowleyml@gmail.com>
Re: [PATCH] bms_prev_member() can read beyond the end of the array of allocated words "Burd, Greg" <greg@burd.me>
Re: [PATCH] bms_prev_member() can read beyond the end of the array of allocated words David Rowley <dgrowleyml@gmail.com>
Re: [PATCH] bms_prev_member() can read beyond the end of the array of allocated words Greg Burd <greg@burd.me>

On Aug 14 2025, at 11:49 am, David Rowley  wrote:

> On Fri, 15 Aug 2025 at 03:43, Greg Burd  wrote:
>> Well, that was rushed.  Apologies.
> 
> Would you be ok with adding the Assert after the "a == NULL" check?, i.e:
> 
> if (a == NULL || prevbit == 0)
>    return -2;
> 
> /* Validate callers didn't give us something out of range */
> Assert(prevbit <= a->nwords * BITS_PER_BITMAPWORD);
> 
> David

Good thinking, less contorted logic and a more obvious check for NULL
and the result to expect in that case.

-greg
В списке pgsql-hackers по дате отправления
От: Tom Lane
Дата:
От: David Rowley
Дата:
FAQ