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

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: [PATCH] bms_prev_member() can read beyond the end of the array of allocated words
Дата
Msg-id CAApHDvpi6LgxtoV=XhTfbsXYa2gULy=JoCxen8s_OszFhAO7bA@mail.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
Список pgsql-hackers
On Fri, 15 Aug 2025 at 03:43, Greg Burd <greg@burd.me> 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



В списке pgsql-hackers по дате отправления: