Dereferenced pointer checks in data.c of ECPG

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Dereferenced pointer checks in data.c of ECPG
Дата
Msg-id CAB7nPqTVc7_LYQXnqhuEf+u-_EGzo5tiPZYdfems2+i9hsJmHw@mail.gmail.com
обсуждение исходный текст
Ответы Re: Dereferenced pointer checks in data.c of ECPG  (Michael Meskes <meskes@postgresql.org>)
Список pgsql-hackers
Hi all,

ecpg_get_data@data.c is using to null-pointer checks for pval but it happens that we have the guarantee that those pointers are never NULL, see for example this piece of code at the code of ecpg_get_data():
        /* pval is a pointer to the value */
        if (!pval)
        {
                /*
                 * This should never happen because we already checked that we found
                 * at least one tuple, but let's play it safe.
                 */
                ecpg_raise(lineno, ECPG_NOT_FOUND, ECPG_SQLSTATE_NO_DATA, NULL);
                return (false);
        }
A patch is attached, and the issue has been spotted by Coverity.
Regards,
--
Michael
Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Precedence of standard comparison operators
Следующее
От: Mark Kirkwood
Дата:
Сообщение: Re: Unable to build pg_rewind