Skip site navigation (1) Skip section navigation (2)

pgsql: Fix write-past-buffer-end in ldapServiceLookup().

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix write-past-buffer-end in ldapServiceLookup().
Date: 2011-05-12 15:58:36
Message-ID: E1QKYHc-0000ZK-Li@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Fix write-past-buffer-end in ldapServiceLookup().

The code to assemble ldap_get_values_len's output into a single string
wrote the terminating null one byte past where it should.  Fix that,
and make some other cosmetic adjustments to make the code a trifle more
readable and more in line with usual Postgres coding style.

Also, free the "result" string when done with it, to avoid a permanent
memory leak.

Bug report and patch by Albe Laurenz, cosmetic adjustments by me.

Branch
------
REL8_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/a7d3110638bd9b8951c11913621e86ac79db1a1f

Modified Files
--------------
src/interfaces/libpq/fe-connect.c |   20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)

pgsql-committers by date

Next:From: Robert HaasDate: 2011-05-12 21:10:49
Subject: pgsql: Kill stray "not".
Previous:From: Alvaro HerreraDate: 2011-05-12 12:53:56
Subject: pgsql: Fix assorted typos

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group