Possible uninitialized use of the variables (src/backend/access/transam/twophase.c)

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Possible uninitialized use of the variables (src/backend/access/transam/twophase.c)
Date: 2022-02-09 11:15:45
Message-ID: CAEudQAooECJ+gU_RZB-yhioPOV94R4ucoHAf68PiJhLpgpVpBw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Commit
https://github.com/postgres/postgres/commit/1eb6d6527aae264b3e0b9c95aa70bb7a594ad1cf,
modified
data struct TwoPhaseFileHeader and added two new fields:

XLogRecPtr origin_lsn; /* lsn of this record at origin node */
TimestampTz origin_timestamp; /* time of prepare at origin node */

I think thay forgot initialize these fields in the function StartPrepare
because,
when calling function save_state_data(&hdr, sizeof(TwoPhaseFileHeader));

I have one report about possible uninitialized usage of the variables.

Best regards,

Ranier Vilela

Attachment Content-Type Size
v1_possible_unitialized_variables_twophase.patch application/octet-stream 603 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2022-02-09 11:48:35 Re: Database-level collation version tracking
Previous Message Ranier Vilela 2022-02-09 10:56:35 [PATCH] Improve function toast_delete_external (src/backend/access/table/toast_helper.c)