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

Commitd59ff4a

Browse files
committed
Fix another instance of unsafe coding for shm_toc_lookup failure.
One or another author of commit5bcf389 seems to have thought thatcomputing an offset from a NULL pointer would yield another NULL pointer.There may possibly be architectures where that works, but common machinesdon't work like that. Per a quick code review of places callingshm_toc_lookup and not using noError = false.
1 parent957ff08 commitd59ff4a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎src/backend/executor/nodeHash.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2582,9 +2582,13 @@ ExecHashInitializeWorker(HashState *node, ParallelWorkerContext *pwcxt)
25822582
{
25832583
SharedHashInfo*shared_info;
25842584

2585+
/* might not be there ... */
25852586
shared_info= (SharedHashInfo*)
25862587
shm_toc_lookup(pwcxt->toc,node->ps.plan->plan_node_id, true);
2587-
node->hinstrument=&shared_info->hinstrument[ParallelWorkerNumber];
2588+
if (shared_info)
2589+
node->hinstrument=&shared_info->hinstrument[ParallelWorkerNumber];
2590+
else
2591+
node->hinstrument=NULL;
25882592
}
25892593

25902594
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp