pgsql: port/snprintf(): fix overflow and do padding - Mailing list pgsql-committers

From Bruce Momjian
Subject pgsql: port/snprintf(): fix overflow and do padding
Date
Msg-id E1YIIVa-0008P9-O0@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
port/snprintf():  fix overflow and do padding

Prevent port/snprintf() from overflowing its local fixed-size
buffer and pad to the desired number of digits with zeros, even
if the precision is beyond the ability of the native sprintf().
port/snprintf() is only used on systems that lack a native
snprintf().

Reported by Bruce Momjian. Patch by Tom Lane.    Backpatch to all
supported versions.

Security: CVE-2015-0242

Branch
------
REL9_3_STABLE

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

Modified Files
--------------
src/port/snprintf.c |   69 +++++++++++++++++++++++++++++++++++++++++++++------
1 file changed, 62 insertions(+), 7 deletions(-)


pgsql-committers by date:

Previous
From: Noah Misch
Date:
Subject: pgsql: Fix buffer overrun after incomplete read in pullf_read_max().
Next
From: Noah Misch
Date:
Subject: pgsql: Fix buffer overrun after incomplete read in pullf_read_max().