]> granicus.if.org Git - postgresql/commit
Fix a passel of ancient bugs in to_char(), including two distinct buffer
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 29 Jun 2007 01:51:49 +0000 (01:51 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 29 Jun 2007 01:51:49 +0000 (01:51 +0000)
commite75311d10b90c8845c8d070aeeac9f7b1ccee5d6
tree4c25f1fb9df8b70775d6bbd2e3aca1b596c48cdf
parent973e33dae72e701d0e1bb9ba1be32c500a130603
Fix a passel of ancient bugs in to_char(), including two distinct buffer
overruns (neither of which seem likely to be exploitable as security holes,
fortunately, since the provoker can't control the data written).  One of
these is due to choosing to stomp on the output of a called function, which
is bad news in any case; make it treat the called functions' results as
read-only.  Avoid some unnecessary palloc/pfree traffic too; it's not
really helpful to free small temporary objects, and again this is presuming
more than it ought to about the nature of the results of called functions.
Per report from Patrick Welche and additional code-reading by Imad.
src/backend/utils/adt/formatting.c