Re: NULL checks of deferenced pointers in picksplit method of intarray

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: NULL checks of deferenced pointers in picksplit method of intarray
Дата
Msg-id 1885338644.4651964.1424123379545.JavaMail.yahoo@mail.yahoo.com
обсуждение исходный текст
Ответ на NULL checks of deferenced pointers in picksplit method of intarray  (Michael Paquier <michael.paquier@gmail.com>)
Ответы Re: NULL checks of deferenced pointers in picksplit method of intarray
Список pgsql-hackers
Michael Paquier <michael.paquier@gmail.com> wrote:

> Coverity is pointing out that _int_split.c has unnecessary checks
> for deferenced pointers in 5 places.

> Attached is a patch to adjust those things.

Pushed.  Thanks!

> Also, as far as I understood from this code, no elements
> manipulated are NULL, perhaps this is worth an assertion?

I'm not clear where you were thinking of, but anyway that seemed
like a separate patch if we're going to do it, so I went ahead with
pushing the issued Coverity flagged.  The arguments to the function
don't need such a check because the function is exposed to SQL with
the STRICT option (but you probably already knew that).  While
reviewing the safety of this patch the only place that I ran across
that I felt maybe deserved an assertion was that n >= 0 near the
top of copy_intArrayType(), but that seems marginal.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Allow "snapshot too old" error, to prevent bloat
Следующее
От: Petr Jelinek
Дата:
Сообщение: Re: TABLESAMPLE patch