Re: [PATCH] Fix possible underflow in expression (maxoff - 1)

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: [PATCH] Fix possible underflow in expression (maxoff - 1)
Дата
Msg-id CAH2-WzkqdPjE8F7gYwFZR_=7ksrdoz+-+0uTLRo+3dutJS-+UQ@mail.gmail.com
обсуждение исходный текст
Ответ на [PATCH] Fix possible underflow in expression (maxoff - 1)  (Ranier Vilela <ranier_gyn@hotmail.com>)
Ответы RE: [PATCH] Fix possible underflow in expression (maxoff - 1)  (Ranier Vilela <ranier_gyn@hotmail.com>)
Список pgsql-hackers
On Sun, Nov 24, 2019 at 9:58 AM Ranier Vilela <ranier_gyn@hotmail.com> wrote:
> Within the function _bt_afternewitemoff, at line 641, maxoff is used in an dangerous expression,
> without protection.:  (maxoff - 1)

I wrote this code. It's safe.

In general, it's not possible to split a page without it being
initialized, and having at least 2 items (not including the incoming
newitem). Besides, even if "maxoff" had an integer underflow the
behavior of the function would still be sane and defined. OffsetNumber
is an unsigned type.

Where are you getting this stuff from? Are you using a static analysis tool?

-- 
Peter Geoghegan



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: LISTEN/NOTIFY testing woes
Следующее
От: Julien Rouhaud
Дата:
Сообщение: Re: Collation versioning