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

Commit7f6fa29

Browse files
committed
Fix user-after-free bug.
Introduced by commitaea5d29.Patch from Amit Kapila. Issue discovered independently by Amit Kapilaand Ashutosh Sharma.
1 parente434ad3 commit7f6fa29

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎src/backend/postmaster/bgworker.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,12 +440,14 @@ ReportBackgroundWorkerExit(slist_mutable_iter *cur)
440440
{
441441
RegisteredBgWorker*rw;
442442
BackgroundWorkerSlot*slot;
443+
intnotify_pid;
443444

444445
rw=slist_container(RegisteredBgWorker,rw_lnode,cur->cur);
445446

446447
Assert(rw->rw_shmem_slot<max_worker_processes);
447448
slot=&BackgroundWorkerData->slot[rw->rw_shmem_slot];
448449
slot->pid=rw->rw_pid;
450+
notify_pid=rw->rw_worker.bgw_notify_pid;
449451

450452
/*
451453
* If this worker is slated for deregistration, do that before notifying
@@ -458,8 +460,8 @@ ReportBackgroundWorkerExit(slist_mutable_iter *cur)
458460
rw->rw_worker.bgw_restart_time==BGW_NEVER_RESTART)
459461
ForgetBackgroundWorker(cur);
460462

461-
if (rw->rw_worker.bgw_notify_pid!=0)
462-
kill(rw->rw_worker.bgw_notify_pid,SIGUSR1);
463+
if (notify_pid!=0)
464+
kill(notify_pid,SIGUSR1);
463465
}
464466

465467
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp