Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Re: Returning non-terminated string in ECPG Informix-compatible function

Поиск
Список
Период
Сортировка
От Oleg Tselebrovskiy
Тема Re: Returning non-terminated string in ECPG Informix-compatible function
Дата
Msg-id 9e6bd5d519c312ffdfa9a3c39b95910f@postgrespro.ru
обсуждение исходный текст
Ответ на Re: Returning non-terminated string in ECPG Informix-compatible function  (Oleg Tselebrovskiy <o.tselebrovskiy@postgrespro.ru>)
Ответы Re: Returning non-terminated string in ECPG Informix-compatible function
Список pgsql-hackers
Greetings again.
I was looking through more static analyzer output and found another 
problem.
In ecpg/pgtypeslib/dt_common.c there are 4 calls of pgtypes_alloc.
This function uses calloc and returns NULL if OOM, but we don't check 
its
return value and immediately pass it to strcpy, which could lead to 
segfault.

I suggest adding a check for a return value since all other calls of
pgtypes_alloc are checked for NULL.

A proposed patch (with previous and current changes) is attached

Oleg Tselebrovskiy, Postgres Pro
Вложения

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