to_char(): prevent writing beyond the allocated buffer

Bruce Momjian <bruce@momjian.us>

Commit: 56b970f2e98853bee7205022df4c5d38bafacdf5
Author: Bruce Momjian <bruce@momjian.us>
Date: 2015-02-02T15:00:52Z
Releases: 9.0.19
to_char():  prevent writing beyond the allocated buffer

Previously very long localized month and weekday strings could
overflow the allocated buffers, causing a server crash.

Reported and patch reviewed by Noah Misch.  Backpatch to all
supported versions.

Security: CVE-2015-0241

Files

PathChange+/−
src/backend/utils/adt/formatting.c modified +126 −15