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

Commit62d0477

Browse files
committed
fix incorrect usage of memcpy() in start_bgworker()
1 parent945f224 commit62d0477

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

‎src/pathman_workers.c‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,17 +185,16 @@ start_bgworker(const char bgworker_name[BGW_MAXLEN],
185185
pid_tpid;
186186

187187
/* Initialize worker struct */
188-
memcpy(worker.bgw_name,bgworker_name,BGW_MAXLEN);
189-
memcpy(worker.bgw_function_name,bgworker_proc,BGW_MAXLEN);
190-
memcpy(worker.bgw_library_name,"pg_pathman",BGW_MAXLEN);
188+
memset(&worker,0,sizeof(worker));
189+
190+
snprintf(worker.bgw_name,BGW_MAXLEN,"%s",bgworker_name);
191+
snprintf(worker.bgw_function_name,BGW_MAXLEN,"%s",bgworker_proc);
192+
snprintf(worker.bgw_library_name,BGW_MAXLEN,"pg_pathman");
191193

192194
worker.bgw_flags=BGWORKER_SHMEM_ACCESS |
193195
BGWORKER_BACKEND_DATABASE_CONNECTION;
194196
worker.bgw_start_time=BgWorkerStart_RecoveryFinished;
195197
worker.bgw_restart_time=BGW_NEVER_RESTART;
196-
#ifPG_VERSION_NUM<100000
197-
worker.bgw_main=NULL;
198-
#endif
199198
worker.bgw_main_arg=bgw_arg;
200199
worker.bgw_notify_pid=MyProcPid;
201200

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp