pgsql: Fix breakage of get_ps_display() in the PS_USE_NONE case.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix breakage of get_ps_display() in the PS_USE_NONE case.
Date: 2022-03-27 16:58:21
Message-ID: E1nYWDd-001dPy-8i@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix breakage of get_ps_display() in the PS_USE_NONE case.

Commit 8c6d30f21 caused this function to fail to set *displen
in the PS_USE_NONE code path. If the variable's previous value
had been negative, that'd lead to a memory clobber at some call
sites. We'd managed not to notice due to very thin test coverage
of such configurations, but this appears to explain buildfarm member
lorikeet's recent struggles.

Credit to Andrew Dunstan for spotting the problem. Back-patch
to v13 where the bug was introduced.

Discussion: https://postgr.es/m/136102.1648320427@sss.pgh.pa.us

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/9016a2a3dc4ee7e41ecda5a8b3a3d3481de94964

Modified Files
--------------
src/backend/utils/misc/ps_status.c | 1 +
1 file changed, 1 insertion(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2022-03-27 18:38:40 pgsql: Avoid using large pass-by-value struct arguments in pgbench.
Previous Message Michael Paquier 2022-03-27 09:22:47 pgsql: Fix comment in execParallel.c