From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Fix a bunch of places that called malloc and friends with no NUL
Date: Tue, 30 Aug 2016 22:22:51 +0000
Message-ID: <E1berQh-0005Kp-0d@gemulon.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
Fix a bunch of places that called malloc and friends with no NULL check.
Where possible, use palloc or pg_malloc instead; otherwise, insert
explicit NULL checks.
Generally speaking, these are places where an actual OOM is quite
unlikely, either because they're in client programs that don't
allocate all that much, or they're very early in process startup
so that we'd likely have had a fork() failure instead. Hence,
no back-patch, even though this is nominally a bug fix.
Michael Paquier, with some adjustments by me
Discussion: <CAB7nPqRu07Ot6iht9i9KRfYLpDaF2ZuUv5y_+72uP23ZAGysRg@mail.gmail.com>
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/052cc223d5ce1b727f62afff75797c88d82f880b
Modified Files
--------------
contrib/pg_standby/pg_standby.c | 2 +-
contrib/vacuumlo/vacuumlo.c | 8 ++---
src/backend/bootstrap/bootstrap.c | 14 +++-----
src/backend/port/dynloader/darwin.c | 3 ++
src/backend/utils/misc/ps_status.c | 27 +++++++++++++++
src/bin/pg_archivecleanup/pg_archivecleanup.c | 2 +-
src/bin/psql/command.c | 12 +++++--
src/common/exec.c | 9 +++--
src/test/isolation/isolationtester.c | 14 ++++----
src/test/isolation/specparse.y | 34 +++++++++----------
src/test/isolation/specscanner.l | 4 +--
src/test/regress/pg_regress.c | 48 +++++++++++++--------------
12 files changed, 108 insertions(+), 69 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Fix a bunch of places that called malloc and friends with no NUL
In-Reply-To: <E1berQh-0005Kp-0d@gemulon.postgresql.org>
References: <E1berQh-0005Kp-0d@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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