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

Commit8f68671

Browse files
committed
[PGPRO-3725] zero out garbage in append_rel_array if we allocate it.
Since 1d9056f563f3 (who uses AppendRelInfo* existence as a mark this rel ischild) in 11.7 this led to (known) random segfaults.
1 parentfa068e7 commit8f68671

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎src/hooks.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,9 +498,13 @@ pathman_rel_pathlist_hook(PlannerInfo *root,
498498
irange_len*sizeof(RangeTblEntry*));
499499

500500
#ifPG_VERSION_NUM >=110000
501-
/* Make sure append_rel_array is wide enough */
501+
/*
502+
* Make sure append_rel_array is wide enough; if it hasn't been
503+
* allocated previously, care to zero out [0; current_len) part.
504+
*/
502505
if (root->append_rel_array==NULL)
503-
root->append_rel_array= (AppendRelInfo**)palloc0(0);
506+
root->append_rel_array= (AppendRelInfo**)
507+
palloc0(current_len*sizeof(AppendRelInfo*));
504508
root->append_rel_array= (AppendRelInfo**)
505509
repalloc(root->append_rel_array,
506510
new_len*sizeof(AppendRelInfo*));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp