Re: [PATCH] Explicit null dereferenced (src/backend/access/heap/heaptoast.c)

Поиск
Список
Период
Сортировка
От gkokolatos@pm.me
Тема Re: [PATCH] Explicit null dereferenced (src/backend/access/heap/heaptoast.c)
Дата
Msg-id 2zIuwcF8JVo_GspzTQrXNXm46G-EwR2XRg9xFAWSoWjGR_2Rn90aJzRp692-eLIS1mgRKn95TJdCQZN2hdrTj0agUyhypmz9izCw4EiE6Ms=@pm.me
обсуждение исходный текст
Ответ на [PATCH] Explicit null dereferenced (src/backend/access/heap/heaptoast.c)  (Ranier Vilela <ranier.vf@gmail.com>)
Ответы Re: [PATCH] Explicit null dereferenced (src/backend/access/heap/heaptoast.c)  (Ranier Vilela <ranier.vf@gmail.com>)
Список pgsql-hackers




‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Friday, 28 August 2020 03:22, Ranier Vilela <ranier.vf@gmail.com> wrote:

> Hi,
>
> Per Coverity.
>
> When "Prepare for toasting", it is necessary to turn off the flag TOAST_NEEDS_DELETE_OLD,
> if there is no need to delete external values from the old tuple, otherwise,
> there are dereference NULL at toast_helper.c (on toast_tuple_cleanup function).
>

Excuse my ignorance, isn't this a false positive?

Regardless right after prepare for toasting, a call to toast_tuple_init is made which will explicitly and
unconditionallyset ttc_flags to zero so the flag bit set in the patch will be erased anyways. This patch may make
coverityhappy but does not really change anything in the behaviour of the code. 

Furthermore, in the same function, toast_tuple_init, the flag is set to TOAST_NEEDS_DELETE_OLD after the old value is
actuallyinspected and found to not be null, be stored on disk and to be different than the new value. To my
understanding,this seems to be correct. 

Can you please explain to me what I am missing?

//Georgios

> regards,
> Ranier Vilela





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

Предыдущее
От: Sachin Khanna
Дата:
Сообщение: RE: Please help for error ( file is required for XML support )
Следующее
От: Masahiro Ikeda
Дата:
Сообщение: Re: Display individual query in pg_stat_activity