]> granicus.if.org Git - postgresql/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:52 +0000 (10:00 -0500)
commit9e05c5063eb01ce52618f29fe975696dc4495e6f
tree8d07e5833109d998e50b705e0dbe7c3448eaf11c
parent56b970f2e98853bee7205022df4c5d38bafacdf5
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