[Patch] Fix bounds check in trim_array()

Поиск
Список
Период
Сортировка
От Martin Kalcher
Тема [Patch] Fix bounds check in trim_array()
Дата
Msg-id baaeb413-b8a8-4656-5757-ef347e5ec11f@aboutsource.net
обсуждение исходный текст
Ответы Re: [Patch] Fix bounds check in trim_array()  (Nathan Bossart <nathandbossart@gmail.com>)
Список pgsql-hackers
Hi,

while working on something else i encountered a bug in the trim_array() 
function. The bounds check fails for empty arrays without any 
dimensions. It reads the size of the non existing first dimension to 
determine the arrays length.

   select trim_array('{}'::int[], 10);
   ------------
    {}

   select trim_array('{}'::int[], 100);
   ERROR:  number of elements to trim must be between 0 and 64

The attached patch fixes that check.

Martin
Вложения

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

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Re: Cleaning up historical portability baggage
Следующее
От: vignesh C
Дата:
Сообщение: Re: Handle infinite recursion in logical replication setup