pgsql: Check return value of strdup() in libpq connection option parsin

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Check return value of strdup() in libpq connection option parsin
Date: 2014-11-25 13:21:40
Message-ID: E1XtG3o-0002Zo-TC@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Check return value of strdup() in libpq connection option parsing.

An out-of-memory in most of these would lead to strange behavior, like
connecting to a different database than intended, but some would lead to
an outright segfault.

Alex Shulgin and me. Backpatch to all supported versions.

Branch
------
REL9_0_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/1f35170395b79224cda272ba97572b515d57f0d8

Modified Files
--------------
src/interfaces/libpq/fe-connect.c | 187 +++++++++++++++++++++++++------------
1 file changed, 129 insertions(+), 58 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2014-11-25 13:32:57 Re: pgsql: Add infrastructure to save and restore GUC values.
Previous Message Heikki Linnakangas 2014-11-25 07:48:15 pgsql: Make Port->ssl_in_use available, even when built with !USE_SSL