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

Commita7db71e

Browse files
author
Amit Kapila
committed
Fix uninitialized slot array access during the upgrade.
Commit29d0a77 introduced fetching slot information from the old clusterbut didn't initialize the required array in all the code paths. So whentrying to access the array in verbose mode for the new cluster, it leadsto an uninitialized memory access.Author: Vignesh CDiscussion:http://postgr.es/m/CALDaNm1tntGP5=CtMz=v+k3_PGv7kE9t6iWSgX-QiurAaFkhZw@mail.gmail.com
1 parent108161b commita7db71e

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

‎src/bin/pg_upgrade/info.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ get_db_infos(ClusterInfo *cluster)
408408
i_spclocation=PQfnumber(res,"spclocation");
409409

410410
ntups=PQntuples(res);
411-
dbinfos= (DbInfo*)pg_malloc(sizeof(DbInfo)*ntups);
411+
dbinfos= (DbInfo*)pg_malloc0(sizeof(DbInfo)*ntups);
412412

413413
for (tupnum=0;tupnum<ntups;tupnum++)
414414
{
@@ -636,15 +636,11 @@ get_old_cluster_logical_slot_infos(DbInfo *dbinfo, bool live_check)
636636
PGconn*conn;
637637
PGresult*res;
638638
LogicalSlotInfo*slotinfos=NULL;
639-
intnum_slots=0;
639+
intnum_slots;
640640

641641
/* Logical slots can be migrated since PG17. */
642642
if (GET_MAJOR_VERSION(old_cluster.major_version) <=1600)
643-
{
644-
dbinfo->slot_arr.slots=slotinfos;
645-
dbinfo->slot_arr.nslots=num_slots;
646643
return;
647-
}
648644

649645
conn=connectToServer(&old_cluster,dbinfo->db_name);
650646

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp