Fix possible bogus array out of bonds (src/backend/access/brin/brin_minmax_multi.c)

Поиск
Список
Период
Сортировка
От Ranier Vilela
Тема Fix possible bogus array out of bonds (src/backend/access/brin/brin_minmax_multi.c)
Дата
Msg-id CAEudQAqJQzPitufX-jR=YUbJafpCDAKUnwgdbX_MzSc93wuvdw@mail.gmail.com
обсуждение исходный текст
Ответы Re: Fix possible bogus array out of bonds (src/backend/access/brin/brin_minmax_multi.c)  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Re: Fix possible bogus array out of bonds (src/backend/access/brin/brin_minmax_multi.c)  (David Rowley <dgrowleyml@gmail.com>)
Список pgsql-hackers
Hi,

At function has_matching_range, if variable ranges->nranges == 0,
we exit quickly with a result equal to false.

This means that nranges can be zero.
It occurs then that it is possible then to occur an array out of bonds, in the initialization of the variable maxvalue.
So if nranges is equal to zero, there is no need to initialize minvalue and maxvalue.

The patch tries to fix it, avoiding possible errors by using maxvalue.

regards,
Ranier Vilela
Вложения

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: windows cfbot failing: my_perl
Следующее
От: Robert Haas
Дата:
Сообщение: Re: standby promotion can create unreadable WAL