Skip to content

Commit 0fb6954

Browse files
committed
Fix breakage of get_ps_display() in the PS_USE_NONE case.
Commit 8c6d30f 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
1 parent 411b913 commit 0fb6954

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/backend/utils/misc/ps_status.c

+1
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,7 @@ get_ps_display(int *displen)
443443

444444
return ps_buffer + ps_buffer_fixed_size;
445445
#else
446+
*displen = 0;
446447
return "";
447448
#endif
448449
}

0 commit comments

Comments
 (0)