pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: In pg_log_generic(), be more paranoid about preserving errno.
2+ messages / 1 participants
[nested] [flat]

* pgsql: In pg_log_generic(), be more paranoid about preserving errno.
@ 2019-07-06 15:26  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2019-07-06 15:26 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

In pg_log_generic(), be more paranoid about preserving errno.

This code failed to account for the possibility that malloc() would
change errno, resulting in wrong output for %m, not to mention the
possibility of message truncation.  Such a change is obviously
expected when malloc fails, but there's reason to fear that on some
platforms even a successful malloc call can modify errno.

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

Branch
------
REL_12_STABLE

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

Modified Files
--------------
src/common/logging.c | 2 ++
1 file changed, 2 insertions(+)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: In pg_log_generic(), be more paranoid about preserving errno.
@ 2019-07-06 15:26  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2019-07-06 15:26 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

In pg_log_generic(), be more paranoid about preserving errno.

This code failed to account for the possibility that malloc() would
change errno, resulting in wrong output for %m, not to mention the
possibility of message truncation.  Such a change is obviously
expected when malloc fails, but there's reason to fear that on some
platforms even a successful malloc call can modify errno.

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

Branch
------
master

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

Modified Files
--------------
src/common/logging.c | 2 ++
1 file changed, 2 insertions(+)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2019-07-06 15:26 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-07-06 15:26 pgsql: In pg_log_generic(), be more paranoid about preserving errno. Tom Lane <tgl@sss.pgh.pa.us>
2019-07-06 15:26 pgsql: In pg_log_generic(), be more paranoid about preserving errno. Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox