From: | Alexander Kuznetsov <kuznetsovam(at)altlinux(dot)org> |
---|---|
To: | pgsql-hackers(at)lists(dot)postgresql(dot)org |
Cc: | nickel(at)altlinux(dot)org, egori(at)altlinux(dot)org |
Subject: | Possible null pointer dereference in afterTriggerAddEvent() |
Date: | 2024-07-25 13:32:59 |
Message-ID: | 6d0323c3-3f5d-4137-af73-98a5ab90e77c@altlinux.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hello everyone,
In src/backend/commands/trigger.c:4031, there is an afterTriggerAddEvent() function. The variable chunk is assigned the value of events->tail at line 4050. Subsequently, chunk is compared to NULL at lines 4051 and 4079, indicating that events->tail could 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
Attachment | Content-Type | Size |
---|---|---|
0001-Add-assertion-of-an-empty-list-in-afterTriggerAddEve.patch | text/x-patch | 982 bytes |
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Eisentraut | 2024-07-25 13:42:29 | Re: add function argument names to regex* functions. |
Previous Message | Peter Eisentraut | 2024-07-25 13:31:05 | Re: Add 64-bit XIDs into PostgreSQL 15 |