Re: Potential NULL dereference found in typecmds.c

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: Potential NULL dereference found in typecmds.c
Дата
Msg-id 4E11BCA3.1080502@enterprisedb.com
обсуждение исходный текст
Ответ на Re: Potential NULL dereference found in typecmds.c  (Peter Geoghegan <peter@2ndquadrant.com>)
Ответы Re: Potential NULL dereference found in typecmds.c
Список pgsql-hackers
On 04.07.2011 16:07, Peter Geoghegan wrote:
> On 4 July 2011 13:53, Magnus Hagander<magnus@hagander.net>  wrote:
>> This code is no longer present in git head, *removed* by commit
>> 426cafc. Not added by it. at least that's how I read the history...
>>
>> However, it still looks to me like we could get to that code with
>> con=NULL - if the while loop is never executed. Perhaps this is a
>> can-never-happen situation? Alvaro?
>
> Seems slightly academic IMHO. No code path should dereference an
> invariably NULL or wild pointer.

That error message is bogus anyway:

>     if (!found)
>         ereport(ERROR,
>                 (errcode(ERRCODE_UNDEFINED_OBJECT),
>                  errmsg("constraint \"%s\" of domain \"%s\" does not exist",
>                         constrName, NameStr(con->conname))));

It passes con->conname as the name of the domain, which is just wrong. 
It should be TypeNameToString(typename) instead. The second error 
message that follows has the same bug.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: Potential NULL dereference found in typecmds.c
Следующее
От: Radoslaw Smogura
Дата:
Сообщение: Re: Crash dumps