pgsql: Avoid 0-length memcpy to NULL with EXEC_BACKEND

2024-07-03 Thread Heikki Linnakangas
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.

pgsql: Avoid 0-length memcpy to NULL with EXEC_BACKEND

2024-07-03 Thread Heikki Linnakangas
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.