]> git.ipfire.org Git - thirdparty/postgresql.git/commit
port/snprintf(): fix overflow and do padding
authorBruce Momjian <bruce@momjian.us>
Mon, 2 Feb 2015 15:00:45 +0000 (10:00 -0500)
committerBruce Momjian <bruce@momjian.us>
Mon, 2 Feb 2015 15:00:50 +0000 (10:00 -0500)
commitbc4d5f2e57379feb7a577d25da2681a77e7ca854
tree6f837b2ae407197cc42a0e679b91b0e6d0c42350
parentfe2526990b821efb9452fa8601ee216a487202ff
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
src/port/snprintf.c