Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf3412a6

Browse files
committed
Avoid 0-length memcpy to NULL with EXEC_BACKEND
memcpy(NULL, src, 0) is forbidden by POSIX, even though everyproduction 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.gmail.com
1 parenta06e8f8 commitf3412a6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎src/backend/postmaster/launch_backend.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,8 @@ save_backend_variables(BackendParameters *param, ClientSocket *client_sock,
762762
strlcpy(param->pkglib_path,pkglib_path,MAXPGPATH);
763763

764764
param->startup_data_len=startup_data_len;
765-
memcpy(param->startup_data,startup_data,startup_data_len);
765+
if (startup_data_len>0)
766+
memcpy(param->startup_data,startup_data,startup_data_len);
766767

767768
return true;
768769
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp