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

Поиск
Список
Период
Сортировка
От Kyotaro Horiguchi
Тема Re: Fix possible bogus array out of bonds (src/backend/access/brin/brin_minmax_multi.c)
Дата
Msg-id 20220829.100655.833145569595987997.horikyota.ntt@gmail.com
обсуждение исходный текст
Ответ на Fix possible bogus array out of bonds (src/backend/access/brin/brin_minmax_multi.c)  (Ranier Vilela <ranier.vf@gmail.com>)
Ответы Re: Fix possible bogus array out of bonds (src/backend/access/brin/brin_minmax_multi.c)  (Ranier Vilela <ranier.vf@gmail.com>)
Re: Fix possible bogus array out of bonds (src/backend/access/brin/brin_minmax_multi.c)  (Justin Pryzby <pryzby@telsasoft.com>)
Список pgsql-hackers
At Fri, 26 Aug 2022 10:28:50 -0300, Ranier Vilela <ranier.vf@gmail.com> wrote in 
> 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.

However it seems that nranges will never be zero, still the fix looks
good to me since it is generally allowed to be zero. I don't find a
similar mistake related to Range.nranges.


regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



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

Предыдущее
От: Zhihong Yu
Дата:
Сообщение: Re: Removing unneeded self joins
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: [PATCH] Add native windows on arm64 support