[COMMITTERS] pgsql: Fix off-by-one in memory allocation for quote_literal_cstr(). - Mailing list pgsql-committers

From Heikki Linnakangas
Subject [COMMITTERS] pgsql: Fix off-by-one in memory allocation for quote_literal_cstr().
Date
Msg-id E1cHqDR-0000zw-Lf@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix off-by-one in memory allocation for quote_literal_cstr().

The calculation didn't take into account the NULL terminator. That lead
to overwriting the palloc'd buffer by one byte, if the input consists
entirely of backslashes. For example "format('%L', E'\\')".

Fixes bug #14468. Backpatch to all supported versions.

Report: https://www.postgresql.org/message-id/20161216105001.13334.42819%40wrigleys.postgresql.org

Branch
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/779325478e7e867c636c3e1ad1e5df734e7549e5

Modified Files
--------------
src/backend/utils/adt/quote.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: [COMMITTERS] pgsql: Sync our copy of the timezone library with IANA releasetzcode20
Next
From: Robert Haas
Date:
Subject: [COMMITTERS] pgsql: Remove _hash_wrtbuf() in favor of calling MarkBufferDirty().