Fix possible NULL pointer dereference in GetNamedDSMSegment().
Nathan Bossart <nathan@postgresql.org>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/storage/ipc/dsm_registry.c | modified | +12 −9 |
Discussion
- introduce dynamic shared memory registry 51 messages · 2023-12-05 → 2024-01-23