Re: Two coverity non-bugs

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Two coverity non-bugs
Дата
Msg-id 20060419144807.GK15420@svana.org
обсуждение исходный текст
Ответ на Re: Two coverity non-bugs  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Two coverity non-bugs  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
On Wed, Apr 19, 2006 at 10:32:21AM -0400, Tom Lane wrote:
> The first patch looks reasonable but I object to the second.  Coverity
> is not going to dictate coding conventions to us --- it is not *nearly*
> bright enough for that.  In this case, the code is locally allowing for
> the possibility that AH->currSchema was NULL, and I don't consider it
> good style to remove that allowance.  (I take it BTW that this allegedly
> bulletproof tool fails to consider the possibility that strdup fails
> and returns NULL ...)

Sure. These are just high on the scale of silliness. There are many
more that are less silly which I'm just ignoring.

Note, what coverity actually picked up was that in the latter case in
_selectOutputSchema that the free will always execute because if
AH->currSchema was NULL it would have died at the beginning of the
function (line 2205). It's me who misinterpreted the fix. We should
probably be adding checks to all the strdups and to line 2205 instead.

It doesn't directly complain about strdup itself because nowhere does
any code do a strdup and dereference it in the same function.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [BUGS] bug in windows xp
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Patch for #2391: "Similar to" pattern matching does not operate as documented