pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Avoid 0-length memcpy to NULL with EXEC_BACKEND 2+ messages / 1 participants [nested] [flat]
* pgsql: Avoid 0-length memcpy to NULL with EXEC_BACKEND @ 2024-07-03 13:22 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 2+ messages in thread From: Heikki Linnakangas @ 2024-07-03 13:22 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid 0-length memcpy to NULL with EXEC_BACKEND memcpy(NULL, src, 0) is forbidden by POSIX, even though every production version of libc allows it. Let's be tidy. Per report from Thomas Munro, running UBSan with EXEC_BACKEND. Backpatch to v17, where this code was added. Discussion: https://www.postgresql.org/message-id/CA%2BhUKG%2Be-dV7YWBzfBZXsgovgRuX5VmvmOT%2Bv0aXiZJ-EKbXcw@mail... Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/f3412a61f3f92d795ce0c8bb715831ec02124bfb Modified Files -------------- src/backend/postmaster/launch_backend.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Avoid 0-length memcpy to NULL with EXEC_BACKEND @ 2024-07-03 13:22 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 2+ messages in thread From: Heikki Linnakangas @ 2024-07-03 13:22 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid 0-length memcpy to NULL with EXEC_BACKEND memcpy(NULL, src, 0) is forbidden by POSIX, even though every production version of libc allows it. Let's be tidy. Per report from Thomas Munro, running UBSan with EXEC_BACKEND. Backpatch to v17, where this code was added. Discussion: https://www.postgresql.org/message-id/CA%2BhUKG%2Be-dV7YWBzfBZXsgovgRuX5VmvmOT%2Bv0aXiZJ-EKbXcw@mail... Branch ------ REL_17_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/95219c020c3c8c59079f264386141065865a810e Modified Files -------------- src/backend/postmaster/launch_backend.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2024-07-03 13:22 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2024-07-03 13:22 pgsql: Avoid 0-length memcpy to NULL with EXEC_BACKEND Heikki Linnakangas <heikki.linnakangas@iki.fi> 2024-07-03 13:22 pgsql: Avoid 0-length memcpy to NULL with EXEC_BACKEND Heikki Linnakangas <heikki.linnakangas@iki.fi>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox