Fix syslogger NULL-pointer-dereference in EXEC_BACKEND

Commit 0c8e082fba8d changed the time at which MyBackendType is assigned,
breaking a careful choreography in syslogger to decide when to write
messages to its own log files.  Fix by flipping a boolean at the
(approximate) location where previously MyBackendType was set, instead
of depending on MyBackendType directly.

Author: Álvaro Herrera <[email protected]>
Reported-by: Michael Paquier <[email protected]>
Reviewed-by: Euler Taveira <[email protected]>
Reviewed-by: Michael Paquier <[email protected]>
Discussion: https://postgr.es/m/[email protected]

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/fb23cc7e81db181bfb3dcfed6ad0731a3473d4e1

Modified Files
--------------
src/backend/postmaster/syslogger.c | 19 +++++++++++++++++++
src/backend/utils/error/csvlog.c   |  2 +-
src/backend/utils/error/elog.c     |  6 +++---
src/backend/utils/error/jsonlog.c  |  2 +-
src/include/postmaster/syslogger.h |  1 +
5 files changed, 25 insertions(+), 5 deletions(-)

Reply via email to