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:52:21 +0000 (01:52 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 29 Jun 2007 01:52:21 +0000 (01:52 +0000)
commit26490851c948572160487e3967de427aced81dfc
treefb5831644c58284369b48b90380c92605e602e8c
parent137277efada509776e851801c5cb610ac3b02e3e
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