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

Commit95219c0

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 parent1906b1e commit95219c0

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
@@ -764,7 +764,8 @@ save_backend_variables(BackendParameters *param, ClientSocket *client_sock,
764764
strlcpy(param->pkglib_path,pkglib_path,MAXPGPATH);
765765

766766
param->startup_data_len=startup_data_len;
767-
memcpy(param->startup_data,startup_data,startup_data_len);
767+
if (startup_data_len>0)
768+
memcpy(param->startup_data,startup_data,startup_data_len);
768769

769770
return true;
770771
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp