pgsql: Fix pnstrdup() to not memcpy() the maximum allowed length.

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix pnstrdup() to not memcpy() the maximum allowed length.
Date: 2017-10-09 22:22:04
Message-ID: E1e1gR2-0005fC-SP@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix pnstrdup() to not memcpy() the maximum allowed length.

The previous behaviour was dangerous if the length passed wasn't the
size of the underlying buffer, but the maximum size of the underlying
buffer.

Author: Andres Freund
Discussion: https://postgr.es/m/20161003215524.mwz5p45pcverrkyk@alap3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/82c117cb90e6b6b79f06d61eb1ddf06e94e75b60

Modified Files
--------------
src/backend/utils/mmgr/mcxt.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2017-10-09 23:15:09 Re: pgsql: Add pg_strnlen() a portable implementation of strlen.
Previous Message Peter Eisentraut 2017-10-09 11:51:11 pgsql: Remove unused documentation file