Commit 3f7a59c5 authored by Tom Lane's avatar Tom Lane

Fix breakage of get_ps_display() in the PS_USE_NONE case.

Commit 8c6d30f2 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
parent 27d38444
...@@ -443,6 +443,7 @@ get_ps_display(int *displen) ...@@ -443,6 +443,7 @@ get_ps_display(int *displen)
return ps_buffer + ps_buffer_fixed_size; return ps_buffer + ps_buffer_fixed_size;
#else #else
*displen = 0;
return ""; return "";
#endif #endif
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment