pgsql: Don't use ordinary NULL-terminated strings as Name datums.

From: Noah Misch <noah(at)leadboat(dot)com>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Don't use ordinary NULL-terminated strings as Name datums.
Date: 2013-06-12 23:57:16
Message-ID: E1Umuui-0007kc-L7@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Don't use ordinary NULL-terminated strings as Name datums.

Consumers are entitled to read the full 64 bytes pertaining to a Name;
using a shorter NULL-terminated string leads to reading beyond the end
its allocation; a SIGSEGV is possible. Use the frequent idiom of
copying to a NameData on the stack. New in 9.3, so no back-patch.

Branch
------
master

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

Modified Files
--------------
src/backend/commands/alter.c | 4 +++-
src/backend/commands/event_trigger.c | 8 ++++++--
2 files changed, 9 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2013-06-13 17:13:15 pgsql: Only install a portal's ResourceOwner if it actually has one.
Previous Message Tom Lane 2013-06-12 21:53:53 pgsql: Improve updatability checking for views and foreign tables.