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