Possible null pointer dereference in afterTriggerAddEvent()

Поиск
Список
Период
Сортировка
От Alexander Kuznetsov
Тема Possible null pointer dereference in afterTriggerAddEvent()
Дата
Msg-id 6d0323c3-3f5d-4137-af73-98a5ab90e77c@altlinux.org
обсуждение исходный текст
Ответы Re: Possible null pointer dereference in afterTriggerAddEvent()
Список pgsql-hackers
Hello everyone,

In src/backend/commands/trigger.c:4031, there is an afterTriggerAddEvent() function. The variable chunk is assigned the
valueof events->tail at line 4050. Subsequently, chunk is compared to NULL at lines 4051 and 4079, indicating that
events->tailcould potentially be NULL.
 

However, at line 4102, we dereference events->tail by accessing events->tail->next without first checking if it is
NULL.

To address this issue, I propose at least adding an assertion to ensure that events->tail != NULL before the
dereference.The suggested patch is included in the attachment.
 

-- 
Best regards,
Alexander Kuznetsov
Вложения

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