| From: | Nathan Bossart <nathan(at)postgresql(dot)org> |
|---|---|
| To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
| Subject: | pgsql: Fix possible NULL pointer dereference in GetNamedDSMSegment(). |
| Date: | 2024-01-23 02:45:24 |
| Message-ID: | E1rS6my-002fhV-62@gemulon.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers |
Fix possible NULL pointer dereference in GetNamedDSMSegment().
GetNamedDSMSegment() doesn't check whether dsm_attach() returns
NULL, which creates the possibility of a NULL pointer dereference
soon after. To fix, emit an ERROR if dsm_attach() returns NULL.
This shouldn't happen, but it would be nice to avoid a segfault if
it does. In passing, tidy up the surrounding code.
Reported-by: Tom Lane
Reviewed-by: Michael Paquier, Bharath Rupireddy
Discussion: https://postgr.es/m/3348869.1705854106%40sss.pgh.pa.us
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/4372adfa24f2f5ddc587317d634b5389bd764106
Modified Files
--------------
src/backend/storage/ipc/dsm_registry.c | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Michael Paquier | 2024-01-23 03:01:47 | pgsql: ci: Enable injection points in builds |
| Previous Message | Michael Paquier | 2024-01-23 01:49:52 | pgsql: Fix ERROR message in injection_point.c |